Documentation
¶
Index ¶
- type Dialect
- type Generator
- type MySQLDialect
- func (d *MySQLDialect) AutoIncrement() string
- func (d *MySQLDialect) BooleanType() string
- func (d *MySQLDialect) DefaultValue(value interface{}, fieldType definition.FieldType) string
- func (d *MySQLDialect) MapType(fieldType definition.FieldType, length int, precision int, scale int) string
- func (d *MySQLDialect) Name() string
- func (d *MySQLDialect) QuoteIdentifier(name string) string
- type PostgreSQLDialect
- func (d *PostgreSQLDialect) AutoIncrement() string
- func (d *PostgreSQLDialect) BooleanType() string
- func (d *PostgreSQLDialect) DefaultValue(value interface{}, fieldType definition.FieldType) string
- func (d *PostgreSQLDialect) MapType(fieldType definition.FieldType, length int, precision int, scale int) string
- func (d *PostgreSQLDialect) Name() string
- func (d *PostgreSQLDialect) QuoteIdentifier(name string) string
- type SQLiteDialect
- func (d *SQLiteDialect) AutoIncrement() string
- func (d *SQLiteDialect) BooleanType() string
- func (d *SQLiteDialect) DefaultValue(value interface{}, fieldType definition.FieldType) string
- func (d *SQLiteDialect) MapType(fieldType definition.FieldType, length int, precision int, scale int) string
- func (d *SQLiteDialect) Name() string
- func (d *SQLiteDialect) QuoteIdentifier(name string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dialect ¶
type Dialect interface {
Name() string
MapType(fieldType definition.FieldType, length int, precision int, scale int) string
QuoteIdentifier(name string) string
AutoIncrement() string
BooleanType() string
DefaultValue(value interface{}, fieldType definition.FieldType) string
}
Dialect represents a SQL dialect
type Generator ¶
type Generator struct {
// contains filtered or unexported fields
}
Generator generates SQL migration files
func NewGenerator ¶
NewGenerator creates a new SQL generator
func (*Generator) Description ¶
Description returns the generator description
type MySQLDialect ¶
type MySQLDialect struct{}
MySQLDialect implements MySQL dialect
func (*MySQLDialect) AutoIncrement ¶
func (d *MySQLDialect) AutoIncrement() string
func (*MySQLDialect) BooleanType ¶
func (d *MySQLDialect) BooleanType() string
func (*MySQLDialect) DefaultValue ¶
func (d *MySQLDialect) DefaultValue(value interface{}, fieldType definition.FieldType) string
func (*MySQLDialect) MapType ¶
func (d *MySQLDialect) MapType(fieldType definition.FieldType, length int, precision int, scale int) string
func (*MySQLDialect) Name ¶
func (d *MySQLDialect) Name() string
func (*MySQLDialect) QuoteIdentifier ¶
func (d *MySQLDialect) QuoteIdentifier(name string) string
type PostgreSQLDialect ¶
type PostgreSQLDialect struct{}
PostgreSQLDialect implements PostgreSQL dialect
func (*PostgreSQLDialect) AutoIncrement ¶
func (d *PostgreSQLDialect) AutoIncrement() string
func (*PostgreSQLDialect) BooleanType ¶
func (d *PostgreSQLDialect) BooleanType() string
func (*PostgreSQLDialect) DefaultValue ¶
func (d *PostgreSQLDialect) DefaultValue(value interface{}, fieldType definition.FieldType) string
func (*PostgreSQLDialect) MapType ¶
func (d *PostgreSQLDialect) MapType(fieldType definition.FieldType, length int, precision int, scale int) string
func (*PostgreSQLDialect) Name ¶
func (d *PostgreSQLDialect) Name() string
func (*PostgreSQLDialect) QuoteIdentifier ¶
func (d *PostgreSQLDialect) QuoteIdentifier(name string) string
type SQLiteDialect ¶
type SQLiteDialect struct{}
SQLiteDialect implements SQLite dialect
func (*SQLiteDialect) AutoIncrement ¶
func (d *SQLiteDialect) AutoIncrement() string
func (*SQLiteDialect) BooleanType ¶
func (d *SQLiteDialect) BooleanType() string
func (*SQLiteDialect) DefaultValue ¶
func (d *SQLiteDialect) DefaultValue(value interface{}, fieldType definition.FieldType) string
func (*SQLiteDialect) MapType ¶
func (d *SQLiteDialect) MapType(fieldType definition.FieldType, length int, precision int, scale int) string
func (*SQLiteDialect) Name ¶
func (d *SQLiteDialect) Name() string
func (*SQLiteDialect) QuoteIdentifier ¶
func (d *SQLiteDialect) QuoteIdentifier(name string) string
Click to show internal directories.
Click to hide internal directories.