Initial working stage, but not with all tests, because IF NOT EXISTS is not implemented
This commit is contained in:
34
table.go
Normal file
34
table.go
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user