Initial giu version, not very good looking, maybe prefer CharmBracelet Tea

This commit is contained in:
Pablu
2025-10-28 19:13:43 +01:00
parent 396b531013
commit e2d39f715f
10 changed files with 313 additions and 56 deletions

View File

@@ -2,13 +2,17 @@ package sql
import "fmt"
type Statement interface {
isEnumValue()
}
type CreateTableStatement struct {
TableName string
Columns []Column
}
func (c *CreateTableStatement) Print() {
fmt.Printf("Name: %v\nColumns:\n", c.TableName)
fmt.Printf("Name: %v\nColumns:\n", c.TableName)
for _, column := range c.Columns {
fmt.Printf("- Name: %v\n Type: %v\n Extras:\n", column.Name, column.Type)
for _, extra := range column.Extra {
@@ -22,3 +26,12 @@ type Column struct {
Type string
Extra []string
}
// Unused, just for example sake for now
type SelectStatement struct {
From string
Fields []string
}
func (_ *CreateTableStatement) isEnumValue() {}
func (_ *SelectStatement) isEnumValue() {}