Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Command ¶
type Command struct {
Database *Database `"DATABASE" @@`
Roles *Roles `| "ROLES" @@`
Extensions *Extensions `| "EXTENSIONS" @@`
Schemas *Schemas `| "SCHEMAS" @@`
ForeignKeys *ForeignKeys `| ("FOREIGN" "KEYS") @@`
Schema *Name `| "SCHEMA" @@`
TablesInSchema *Name `| "TABLES" "IN" @@`
ViewsInSchema *Name `| "VIEWS" "IN" @@`
Table *SchemaItem `| "TABLE" @@`
View *SchemaItem `| "VIEW" @@`
Indexes *SchemaItem `| "INDEXES" "ON" @@`
Constraints *SchemaItem `| "CONSTRAINTS" "ON" @@`
}
Command contains details of a create or drop command. Only one of the members will be `true` or populated.
type DDSL ¶
type DDSL struct {
Create *Command `"CREATE" @@`
Drop *Command `| "DROP" @@`
Migrate *Migrate `| "MIGRATE" @@`
Sql *string `| "SQL" @Sql`
Seed *SeedCommand `| "SEED" @@`
}
DDSL is the top level struct of the parser. Only one of the members will be populated.
type Database ¶
type Database struct {
Ref *Ref `[@@]`
}
Database contains details for action on a database.
type Extensions ¶
type Extensions struct {
Ref *Ref `[@@]`
}
Extensions contains details for action on extensions.
type ForeignKeys ¶
type ForeignKeys struct {
Ref *Ref `[@@]`
}
ForeignKeys contains details for action on a foreign keys.
type Migrate ¶
type Migrate struct {
Top bool `@"TOP"`
Bottom bool `| @"BOTTOM"`
Up *int `| "UP" @Int`
Down *int `| "DOWN" @Int`
}
Migrate contains the migration command. Only one of the members will be `true` or nonzero.
type Ref ¶
type Ref struct {
Ref string `@Ref`
}
Tag contains the git tag to run the DDSL command against.
type SchemaItem ¶
type SchemaItem struct {
Item string `@SchemaItem`
Ref *Ref `[@@]`
TableOrView string
Schema string
}
SchemaItem contains the schema and table or view when it is the object of the command.
type Schemas ¶
type Schemas struct {
Ref *Ref `[@@]`
}
Schemas contains details for action on schemas.
type SeedCommand ¶
type SeedCommand struct {
Table *SchemaItem `"TABLE" @@`
TablesInSchema *Name `| "TABLES" "IN" @@`
}