Initial giu version, not very good looking, maybe prefer CharmBracelet Tea
This commit is contained in:
15
sql/ast.go
15
sql/ast.go
@@ -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() {}
|
||||
|
||||
Reference in New Issue
Block a user