Documentation
¶
Overview ¶
This package has SQL parser, its abstraction and SQL generator. Never touch database.
Index ¶
- Constants
- func GenerateIdempotentDDLs(mode GeneratorMode, desiredSQL string, currentSQL string) ([]string, error)
- type AddIndex
- type Column
- type ColumnKeyOption
- type CreateIndex
- type CreateTable
- type DDL
- type Generator
- type GeneratorMode
- type Index
- type IndexColumn
- type Table
- type Value
- type ValueType
Constants ¶
View Source
const ( ValueTypeStr = ValueType(iota) ValueTypeInt ValueTypeFloat ValueTypeHexNum ValueTypeHex ValueTypeValArg ValueTypeBit )
View Source
const ( ColumnKeyNone = ColumnKeyOption(iota) ColumnKeyPrimary ColumnKeySpatialKey ColumnKeyUnique ColumnKeyUniqueKey ColumnKey )
View Source
const ( GeneratorModeMysql = GeneratorMode(iota) GeneratorModePostgres )
Variables ¶
This section is empty.
Functions ¶
func GenerateIdempotentDDLs ¶
func GenerateIdempotentDDLs(mode GeneratorMode, desiredSQL string, currentSQL string) ([]string, error)
Parse argument DDLs and call `generateDDLs()`
Types ¶
type ColumnKeyOption ¶
type ColumnKeyOption int
type CreateIndex ¶ added in v0.2.0
type CreateIndex struct {
// contains filtered or unexported fields
}
func (*CreateIndex) Statement ¶ added in v0.2.0
func (c *CreateIndex) Statement() string
type CreateTable ¶
type CreateTable struct {
// contains filtered or unexported fields
}
func (*CreateTable) Statement ¶
func (c *CreateTable) Statement() string
type Generator ¶
type Generator struct {
// contains filtered or unexported fields
}
This struct holds simulated schema states during GenerateIdempotentDDLs().
type GeneratorMode ¶ added in v0.2.0
type GeneratorMode int
type IndexColumn ¶
type IndexColumn struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.