Documentation ¶
Index ¶
- type BuildDDLOpts
- type CreateSequenceParams
- type DDL
- type DDLBuilder
- type DDLBuilderManager
- type MySQLDDLBuilder
- type PostgresDDLBuilder
- func (b *PostgresDDLBuilder) Build(schema *schema.Schema, params BuildDDLOpts) (*DDL, error)
- func (b *PostgresDDLBuilder) BuildPerTable(sch *schema.Schema, opts BuildDDLOpts) ([]*DDL, error)
- func (b *PostgresDDLBuilder) CommentOnColumn(col *schema.Column) string
- func (b *PostgresDDLBuilder) CreateEnum(enum *schema.Enum) string
- func (b *PostgresDDLBuilder) CreatePrimaryKey(name string, columns *gds.Strings) string
- func (b *PostgresDDLBuilder) CreateSequence(seq *schema.Sequence, params CreateSequenceParams) (string, error)
- func (b *PostgresDDLBuilder) CreateUniqueKey(name string, columns *gds.Strings) string
- type QueryBuilder
- func (b *QueryBuilder) BuildDeleteInQuery(table string, field string, values []interface{}) string
- func (b *QueryBuilder) BuildDeleteQueries(table *schema.Table, rows []map[string]interface{}) []string
- func (b *QueryBuilder) BuildDeleteQuery(table string, fields map[string]interface{}) string
- func (b *QueryBuilder) BuildInsertQuery(table *schema.Table, rows []map[string]interface{}) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BuildDDLOpts ¶
type BuildDDLOpts struct { UseIfNotExists bool UseIfExists bool Source config.DatabaseDriver }
type CreateSequenceParams ¶
type CreateSequenceParams struct { UseIfNotExists bool Source config.DatabaseDriver }
type DDLBuilder ¶
type DDLBuilder interface { Build(schema *schema.Schema, opts BuildDDLOpts) (*DDL, error) BuildPerTable(schema *schema.Schema, opts BuildDDLOpts) ([]*DDL, error) }
type DDLBuilderManager ¶
type DDLBuilderManager struct {
// contains filtered or unexported fields
}
func NewDDLBuilderManager ¶
func NewDDLBuilderManager() *DDLBuilderManager
func (*DDLBuilderManager) For ¶
func (m *DDLBuilderManager) For(driver config.DatabaseDriver) DDLBuilder
type MySQLDDLBuilder ¶
type MySQLDDLBuilder struct { }
func NewMySQLDDLBuilder ¶
func NewMySQLDDLBuilder() *MySQLDDLBuilder
func (*MySQLDDLBuilder) Build ¶
func (b *MySQLDDLBuilder) Build(schema *schema.Schema, params BuildDDLOpts) (*DDL, error)
func (*MySQLDDLBuilder) BuildPerTable ¶
func (b *MySQLDDLBuilder) BuildPerTable(sch *schema.Schema, params BuildDDLOpts) ([]*DDL, error)
func (*MySQLDDLBuilder) CreateUniqueKey ¶
func (b *MySQLDDLBuilder) CreateUniqueKey(name string, columns *gds.Strings) string
type PostgresDDLBuilder ¶
type PostgresDDLBuilder struct { }
func NewPostgresDDLBuilder ¶
func NewPostgresDDLBuilder() *PostgresDDLBuilder
func (*PostgresDDLBuilder) Build ¶
func (b *PostgresDDLBuilder) Build(schema *schema.Schema, params BuildDDLOpts) (*DDL, error)
func (*PostgresDDLBuilder) BuildPerTable ¶
func (b *PostgresDDLBuilder) BuildPerTable(sch *schema.Schema, opts BuildDDLOpts) ([]*DDL, error)
func (*PostgresDDLBuilder) CommentOnColumn ¶
func (b *PostgresDDLBuilder) CommentOnColumn(col *schema.Column) string
func (*PostgresDDLBuilder) CreateEnum ¶
func (b *PostgresDDLBuilder) CreateEnum(enum *schema.Enum) string
func (*PostgresDDLBuilder) CreatePrimaryKey ¶
func (b *PostgresDDLBuilder) CreatePrimaryKey(name string, columns *gds.Strings) string
func (*PostgresDDLBuilder) CreateSequence ¶
func (b *PostgresDDLBuilder) CreateSequence(seq *schema.Sequence, params CreateSequenceParams) (string, error)
func (*PostgresDDLBuilder) CreateUniqueKey ¶
func (b *PostgresDDLBuilder) CreateUniqueKey(name string, columns *gds.Strings) string
type QueryBuilder ¶
type QueryBuilder struct { }
func NewInsertBuilder ¶
func NewInsertBuilder() *QueryBuilder
func (*QueryBuilder) BuildDeleteInQuery ¶
func (b *QueryBuilder) BuildDeleteInQuery(table string, field string, values []interface{}) string
func (*QueryBuilder) BuildDeleteQueries ¶
func (b *QueryBuilder) BuildDeleteQueries(table *schema.Table, rows []map[string]interface{}) []string
func (*QueryBuilder) BuildDeleteQuery ¶
func (b *QueryBuilder) BuildDeleteQuery(table string, fields map[string]interface{}) string
func (*QueryBuilder) BuildInsertQuery ¶
Click to show internal directories.
Click to hide internal directories.