Documentation ¶
Index ¶
- Variables
- func Create(db *gorm.DB)
- func IsReservedWord(v string) bool
- func New(config Config) gorm.Dialector
- func Open(dsn string) gorm.Dialector
- type Config
- type Dialector
- func (d Dialector) BindVarTo(writer clause.Writer, stmt *gorm.Statement, v interface{})
- func (d Dialector) ClauseBuilders() map[string]clause.ClauseBuilder
- func (d Dialector) DataTypeOf(field *schema.Field) string
- func (d Dialector) DefaultValueOf(*schema.Field) clause.Expression
- func (d Dialector) DummyTableName() string
- func (d Dialector) Explain(sql string, vars ...interface{}) string
- func (d Dialector) Initialize(db *gorm.DB) (err error)
- func (d Dialector) Migrator(db *gorm.DB) gorm.Migrator
- func (d Dialector) Name() string
- func (d Dialector) QuoteTo(writer clause.Writer, str string)
- func (d Dialector) RewriteLimit(c clause.Clause, builder clause.Builder)
- func (d Dialector) RewriteWhere(c clause.Clause, builder clause.Builder)
- func (d Dialector) RollbackTo(tx *gorm.DB, name string) error
- func (d Dialector) SavePoint(tx *gorm.DB, name string) error
- type Migrator
- func (m Migrator) AddColumn(value interface{}, field string) error
- func (m Migrator) AlterColumn(value interface{}, field string) error
- func (m Migrator) CreateConstraint(value interface{}, name string) error
- func (m Migrator) CreateTable(values ...interface{}) error
- func (m Migrator) CurrentDatabase() (name string)
- func (m Migrator) DropColumn(value interface{}, name string) error
- func (m Migrator) DropConstraint(value interface{}, name string) error
- func (m Migrator) DropIndex(value interface{}, name string) error
- func (m Migrator) DropTable(values ...interface{}) error
- func (m Migrator) HasColumn(value interface{}, field string) bool
- func (m Migrator) HasConstraint(value interface{}, name string) bool
- func (m Migrator) HasIndex(value interface{}, name string) bool
- func (m Migrator) HasTable(value interface{}) bool
- func (m Migrator) RenameIndex(value interface{}, oldName, newName string) error
- func (m Migrator) RenameTable(oldName, newName interface{}) (err error)
- func (m Migrator) TryQuotifyReservedWords(values []interface{}) error
- func (m Migrator) TryRemoveOnUpdate(value interface{}) error
- type Namer
- type NamingStrategy
- func (ns NamingStrategy) CheckerName(table, column string) string
- func (ns NamingStrategy) ColumnName(table, column string) string
- func (ns NamingStrategy) IndexName(table, column string) string
- func (ns NamingStrategy) JoinTableName(str string) string
- func (ns NamingStrategy) RelationshipFKName(rel schema.Relationship) string
- func (ns NamingStrategy) SchemaName(table string) string
- func (ns NamingStrategy) TableName(str string) string
- func (ns NamingStrategy) UniqueName(table string, column string) string
- type Replacer
Constants ¶
This section is empty.
Variables ¶
View Source
var ReservedWords = hashset.New(funk.Map(ReservedWordsList, func(s string) interface{} { return s }).([]interface{})...)
View Source
var ReservedWordsList = []string{}/* 142 elements not displayed */
Functions ¶
Types ¶
type Config ¶
type Dialector ¶
type Dialector struct {
*Config
}
func (Dialector) BindVarTo ¶
func (Dialector) ClauseBuilders ¶
func (d Dialector) ClauseBuilders() map[string]clause.ClauseBuilder
func (Dialector) DefaultValueOf ¶
func (d Dialector) DefaultValueOf(*schema.Field) clause.Expression
func (Dialector) RewriteLimit ¶
func (Dialector) RewriteWhere ¶
type Migrator ¶
func (Migrator) CreateConstraint ¶
func (Migrator) DropConstraint ¶
func (Migrator) HasConstraint ¶
func (Migrator) RenameIndex ¶
https://docs.oracle.com/database/121/SPATL/alter-index-rename.htm
func (Migrator) RenameTable ¶
func (Migrator) TryQuotifyReservedWords ¶
type Namer ¶
type Namer interface { TableName(table string) string SchemaName(table string) string ColumnName(table, column string) string JoinTableName(joinTable string) string RelationshipFKName(schema.Relationship) string CheckerName(table, column string) string IndexName(table, column string) string }
Namer namer interface
type NamingStrategy ¶
type NamingStrategy struct { TablePrefix string SingularTable bool NameReplacer Replacer NoLowerCase bool }
NamingStrategy tables, columns naming strategy
func (NamingStrategy) CheckerName ¶
func (ns NamingStrategy) CheckerName(table, column string) string
CheckerName generate checker name
func (NamingStrategy) ColumnName ¶
func (ns NamingStrategy) ColumnName(table, column string) string
ColumnName convert string to column name
func (NamingStrategy) IndexName ¶
func (ns NamingStrategy) IndexName(table, column string) string
IndexName generate index name
func (NamingStrategy) JoinTableName ¶
func (ns NamingStrategy) JoinTableName(str string) string
JoinTableName convert string to join table name
func (NamingStrategy) RelationshipFKName ¶
func (ns NamingStrategy) RelationshipFKName(rel schema.Relationship) string
RelationshipFKName generate fk name for relation
func (NamingStrategy) SchemaName ¶
func (ns NamingStrategy) SchemaName(table string) string
SchemaName generate schema name from table name, don't guarantee it is the reverse value of TableName
func (NamingStrategy) TableName ¶
func (ns NamingStrategy) TableName(str string) string
TableName convert string to table name
func (NamingStrategy) UniqueName ¶
func (ns NamingStrategy) UniqueName(table string, column string) string
Click to show internal directories.
Click to hide internal directories.