Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Column ¶
type Column struct {
Name string `json:"name"`
Type ColumnType `json:"type"`
Token TokenRange `json:"token"`
InlineRefs []interface{} `json:"inline_refs"`
PK bool `json:"pk"`
Increment *bool `json:"increment,omitempty"`
Unique bool `json:"unique"`
NotNull *bool `json:"not_null,omitempty"`
Note *Note `json:"note,omitempty"`
DBDefault *Default `json:"dbdefault,omitempty"`
Checks *[]interface{} `json:"checks,omitempty"`
}
type ColumnType ¶
type Database ¶
type Database struct {
Schemas []interface{} `json:"schemas"`
Tables []Table `json:"tables"`
Notes []interface{} `json:"notes"`
Refs []Ref `json:"refs"`
Enums []Enum `json:"enums"`
TableGroups []TableGroup `json:"tableGroups"`
Aliases []interface{} `json:"aliases"`
Project interface{} `json:"project"`
TablePartials []interface{} `json:"tablePartials"`
Records []interface{} `json:"records"`
}
type Enum ¶
type Enum struct {
Name string `json:"name"`
SchemaName *string `json:"schemaName"`
Values []EnumValue `json:"values"`
Token TokenRange `json:"token"`
}
type Interpreter ¶
type Interpreter struct {
Errors []Error
}
func New ¶
func New() *Interpreter
func (*Interpreter) Interpret ¶
func (interp *Interpreter) Interpret(prog *parser.ProgramNode) *Database
type Note ¶
type Note struct {
Value string `json:"value"`
Token TokenRange `json:"token"`
}
type Ref ¶
type Ref struct {
Token TokenRange `json:"token"`
Name *string `json:"name"`
SchemaName *string `json:"schemaName"`
Endpoints []RefEndpoint `json:"endpoints"`
}
type RefEndpoint ¶
type RefEndpoint struct {
FieldNames []string `json:"fieldNames"`
TableName string `json:"tableName"`
SchemaName *string `json:"schemaName"`
Relation string `json:"relation"`
Token TokenRange `json:"token"`
}
type Table ¶
type Table struct {
Name string `json:"name"`
SchemaName *string `json:"schemaName"`
Alias *string `json:"alias"`
Fields []Column `json:"fields"`
Token TokenRange `json:"token"`
Indexes []interface{} `json:"indexes"`
Partials []interface{} `json:"partials"`
Checks []interface{} `json:"checks"`
Note *Note `json:"note,omitempty"`
Records *TableRecords `json:"records,omitempty"`
}
type TableGroup ¶
type TableGroup struct {
Name string `json:"name"`
Tables []string `json:"tables"`
Token TokenRange `json:"token"`
}
type TableRecords ¶
TableRecords holds parsed records data for a table.
type TokenRange ¶
Click to show internal directories.
Click to hide internal directories.