Initial working stage, but not with all tests, because IF NOT EXISTS is not implemented

This commit is contained in:
Pablu
2025-10-28 11:29:26 +01:00
commit 15f0d190dc
7 changed files with 526 additions and 0 deletions

24
sql/ast.go Normal file
View 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
}