Initial working stage, but not with all tests, because IF NOT EXISTS is not implemented
This commit is contained in:
24
sql/ast.go
Normal file
24
sql/ast.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package sql
|
||||
|
||||
import "fmt"
|
||||
|
||||
type CreateTableStatement struct {
|
||||
TableName string
|
||||
Columns []Column
|
||||
}
|
||||
|
||||
func (c *CreateTableStatement) Print() {
|
||||
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 {
|
||||
fmt.Printf(" - %v\n", extra)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
type Column struct {
|
||||
Name string
|
||||
Type string
|
||||
Extra []string
|
||||
}
|
||||
Reference in New Issue
Block a user