Documentation
¶
Index ¶
- func AutoMigrate(conf Config) error
- func GetDbByConf(conf Config) *gorm.DB
- func GetDbByModel(m SqlModel) *gorm.DB
- func GormIsErrRecordNotFound(err error) (bool, error)
- func NewClient(conf Config) *client
- func NewGormLogger(opts ...GormLoggerOption) *gormLogger
- func RegisterSqlModel(conf Config, ms ...SqlModel)deprecated
- func RegisterSqlModelWithConf(conf Config, ms ...SqlModel) error
- type Config
- type GormLoggerOption
- type MysqlConfig
- type MysqlDsn
- type SqlModel
- type SqliteConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AutoMigrate ¶
func GetDbByConf ¶
func GetDbByModel ¶
func GormIsErrRecordNotFound ¶
func NewGormLogger ¶
func NewGormLogger(opts ...GormLoggerOption) *gormLogger
func RegisterSqlModel
deprecated
Types ¶
type GormLoggerOption ¶
type GormLoggerOption func(g *gormLogger)
func WithIgnoreRecordNotFound ¶
func WithIgnoreRecordNotFound() GormLoggerOption
func WithPrefix ¶
func WithPrefix(prefix string) GormLoggerOption
func WithSlowThreshold ¶
func WithSlowThreshold(dur time.Duration) GormLoggerOption
type MysqlConfig ¶
func (*MysqlConfig) GetDBType ¶
func (m *MysqlConfig) GetDBType() dbType
func (*MysqlConfig) GetService ¶
func (m *MysqlConfig) GetService() string
func (*MysqlConfig) GetUid ¶
func (m *MysqlConfig) GetUid() string
func (*MysqlConfig) TrimSpace ¶
func (m *MysqlConfig) TrimSpace()
func (*MysqlConfig) Validate ¶
func (m *MysqlConfig) Validate() error
type SqliteConfig ¶
type SqliteConfig struct {
DbFile string
}
func (*SqliteConfig) GetDBType ¶
func (s *SqliteConfig) GetDBType() dbType
func (*SqliteConfig) GetService ¶
func (s *SqliteConfig) GetService() string
func (*SqliteConfig) GetUid ¶
func (s *SqliteConfig) GetUid() string
Click to show internal directories.
Click to hide internal directories.