Documentation
¶
Index ¶
- Variables
- func NewDialector(db *sql.DB) gorm.Dialector
- func NewGorm(le *logrus.Entry, sqlDB *sql.DB, conf *gorm.Config) (*gorm.DB, error)
- type Dialector
- func (d *Dialector) BindVarTo(writer clause.Writer, stmt *gorm.Statement, v any)
- func (d *Dialector) ClauseBuilders() map[string]clause.ClauseBuilder
- func (d *Dialector) DataTypeOf(field *schema.Field) string
- func (d *Dialector) DefaultValueOf(field *schema.Field) clause.Expression
- func (d *Dialector) Explain(sql string, vars ...any) 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) RollbackTo(tx *gorm.DB, name string) error
- func (d *Dialector) SavePoint(tx *gorm.DB, name string) error
- type Logger
- func (l *Logger) Error(_ context.Context, fmt string, args ...any)
- func (l *Logger) Info(_ context.Context, fmt string, args ...any)
- func (l *Logger) LogMode(ll logger.LogLevel) logger.Interface
- func (l *Logger) Trace(ctx context.Context, begin time.Time, fc func() (string, int64), err error)
- func (l *Logger) Warn(_ context.Context, fmt string, args ...any)
- type Migrator
- func (m Migrator) AlterColumn(value any, field string) error
- func (m Migrator) ColumnTypes(value any) (columnTypes []gorm.ColumnType, err error)
- func (m Migrator) DropConstraint(value any, name string) error
- func (m Migrator) DropTable(values ...any) error
- func (m Migrator) FullDataTypeOf(field *schema.Field) clause.Expr
- func (m Migrator) GetTables() (tableList []string, err error)
- func (m Migrator) RenameColumn(value any, oldName, newName string) error
- func (m Migrator) RenameIndex(value any, oldName, newName string) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // CreateClauses create clauses CreateClauses = []string{"INSERT", "VALUES", "ON CONFLICT"} // QueryClauses query clauses QueryClauses = []string{} // UpdateClauses update clauses UpdateClauses = []string{"UPDATE", "SET", "WHERE", "ORDER BY", "LIMIT"} // DeleteClauses delete clauses DeleteClauses = []string{"DELETE", "FROM", "WHERE", "ORDER BY", "LIMIT"} )
Functions ¶
func NewDialector ¶
NewDialector constructs a new dialector from a sql store.
Types ¶
type Dialector ¶
type Dialector struct {
// contains filtered or unexported fields
}
Dialector implements the Dialector interface from gorm.
func (*Dialector) ClauseBuilders ¶
func (d *Dialector) ClauseBuilders() map[string]clause.ClauseBuilder
ClauseBuilders returns the set of clause builders.
func (*Dialector) DefaultValueOf ¶
func (d *Dialector) DefaultValueOf(field *schema.Field) clause.Expression
func (*Dialector) Initialize ¶
Initialize initializes the dialector with a db.
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger implements the gorm logger interface.
type Migrator ¶
Migrator migrates the schema changes between code versions. see information_schema.go:
- numeric_precision: not supported
- date_time_precision: not supported
func (Migrator) ColumnTypes ¶
func (m Migrator) ColumnTypes(value any) (columnTypes []gorm.ColumnType, err error)
func (Migrator) RenameColumn ¶
Click to show internal directories.
Click to hide internal directories.