Documentation ¶
Index ¶
- Variables
- type Config
- type DB
- type Gorm
- type Logger
- func (*Logger) Error(ctx context.Context, tmpl string, args ...interface{})
- func (*Logger) Info(ctx context.Context, tmpl string, args ...interface{})
- func (l *Logger) LogMode(gormlog.LogLevel) gormlog.Interface
- func (*Logger) Trace(ctx context.Context, begin time.Time, fc func() (string, int64), err error)
- func (*Logger) Warn(ctx context.Context, tmpl string, args ...interface{})
- type OptionFunc
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Expr = gorm.Expr Scan = gorm.Scan )
View Source
var ( // ErrRecordNotFound record not found error ErrRecordNotFound = gorm.ErrRecordNotFound // ErrInvalidTransaction invalid transaction when you are trying to `Commit` or `Rollback` ErrInvalidTransaction = gorm.ErrInvalidTransaction // ErrNotImplemented not implemented ErrNotImplemented = gorm.ErrNotImplemented // ErrMissingWhereClause missing where clause ErrMissingWhereClause = gorm.ErrMissingWhereClause // ErrUnsupportedRelation unsupported relations ErrUnsupportedRelation = gorm.ErrUnsupportedRelation // ErrPrimaryKeyRequired primary keys required ErrPrimaryKeyRequired = gorm.ErrPrimaryKeyRequired // ErrModelValueRequired model value required ErrModelValueRequired = gorm.ErrModelValueRequired // ErrInvalidData unsupported data ErrInvalidData = gorm.ErrInvalidData // ErrUnsupportedDriver unsupported driver ErrUnsupportedDriver = gorm.ErrUnsupportedDriver // ErrRegistered registered ErrRegistered = gorm.ErrRegistered // ErrInvalidField invalid field ErrInvalidField = gorm.ErrInvalidField // ErrEmptySlice empty slice found ErrEmptySlice = gorm.ErrEmptySlice // ErrDryRunModeUnsupported dry run mode unsupported ErrDryRunModeUnsupported = gorm.ErrDryRunModeUnsupported // ErrInvalidDB invalid db ErrInvalidDB = gorm.ErrInvalidDB // ErrInvalidValue invalid value ErrInvalidValue = gorm.ErrInvalidValue // ErrInvalidValueOfLength invalid values do not match length ErrInvalidValueOfLength = gorm.ErrInvalidValueOfLength )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Driver string `config:"driver" desc:"SQLDrivers: https://github.com/golang/go/wiki/SQLDrivers"` DSN string `config:"dsn" desc:"Data Source Name"` MaxIdleTime time.Duration `` /* 175-byte string literal not displayed */ MaxLifeTime time.Duration `` /* 171-byte string literal not displayed */ MaxIdleConns int `` /* 299-byte string literal not displayed */ MaxOpenConns int `` /* 358-byte string literal not displayed */ // contains filtered or unexported fields }
Config 配置
type OptionFunc ¶
type OptionFunc func(*Config)
OptionFunc 选项信息
func WithDialector ¶
func WithDialector(dial gorm.Dialector) OptionFunc
Click to show internal directories.
Click to hide internal directories.