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

34
table.go Normal file
View File

@@ -0,0 +1,34 @@
package engine
type Table struct {
Name string
TableValues []TableValue
Rows []Row
}
type ValueFlags uint32
const (
PRIMARY_KEY ValueFlags = 1 << iota
FOREIGN_KEY
NOT_NULL
)
func (v ValueFlags) Has(flag ValueFlags) bool {
return v&flag == flag
}
type TableValue struct {
Type string
Name string
Reference *TableValue
Flags ValueFlags
}
type Value interface {
Representation() string
}
type Row struct {
Values map[TableValue]Value
}