Documentation
¶
Index ¶
- func Close() error
- func CommonDB() *sql.DB
- func Db() *gorm.DB
- func IsRecordNotFoundError(err error) bool
- func Keepalive(ctx context.Context, interval time.Duration)
- func Open() (err error)
- func OpenUntilOk(retryInterval time.Duration) bool
- type AssociationFunc
- type DbMgt
- func CreateTables(models ...interface{}) *DbMgt
- func DefaultDbMgt() *DbMgt
- func New(debug bool, cfg *gorm.Config) *DbMgt
- func OpenUntilOkAndCreateTables(retryInterval time.Duration, models ...interface{}) *DbMgt
- func OpenUntilOkAndDropTableIfExistsThenCreateTables(retryInterval time.Duration, models ...interface{}) *DbMgt
- func Register(models ...interface{}) *DbMgt
- func RegisterAssociationFunc(funcs ...AssociationFunc) *DbMgt
- func SetDbParam(host, port, user, password, name string, ssl bool) *DbMgt
- func SetMysqlParam(host, port, user, password, name, charset, loc string, parseTime bool) *DbMgt
- func SetPgParam(host, port, user, password, name string, ssl bool) *DbMgt
- func SetSqlServerParam(host, port, user, password, name string) *DbMgt
- func SetSqlite3Param(path string) *DbMgt
- func (c *DbMgt) Close() error
- func (c *DbMgt) CommonDB() *sql.DB
- func (c *DbMgt) CreateTables(models ...interface{}) *DbMgt
- func (c *DbMgt) Db() *gorm.DB
- func (c *DbMgt) DropTableIfExists(models ...interface{}) *DbMgt
- func (c *DbMgt) Keepalive(ctx context.Context, interval time.Duration)
- func (c *DbMgt) Open() error
- func (c *DbMgt) OpenUntilOk(retryInterval time.Duration) bool
- func (c *DbMgt) OpenUntilOkAndCreateTables(retryInterval time.Duration, models ...interface{}) *DbMgt
- func (c *DbMgt) OpenUntilOkAndDropTableIfExistsThenCreateTables(retryInterval time.Duration, models ...interface{}) *DbMgt
- func (c *DbMgt) Register(models ...interface{}) *DbMgt
- func (c *DbMgt) RegisterAssociationFunc(funcs ...AssociationFunc) *DbMgt
- func (c *DbMgt) SetDbParam(host, port, user, password, name string, ssl bool) *DbMgt
- func (c *DbMgt) SetMysqlParam(host, port, user, password, name, charset, loc string, parseTime bool) *DbMgt
- func (c *DbMgt) SetPgParam(host, port, user, password, name string, ssl bool) *DbMgt
- func (c *DbMgt) SetSqlServerParam(host, port, user, password, name string) *DbMgt
- func (c *DbMgt) SetSqlite3Param(path string) *DbMgt
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsRecordNotFoundError ¶
func OpenUntilOk ¶
Types ¶
type DbMgt ¶
type DbMgt struct {
// contains filtered or unexported fields
}
func CreateTables ¶
func CreateTables(models ...interface{}) *DbMgt
func DefaultDbMgt ¶
func DefaultDbMgt() *DbMgt
func RegisterAssociationFunc ¶
func RegisterAssociationFunc(funcs ...AssociationFunc) *DbMgt
func SetDbParam ¶
func SetMysqlParam ¶
func SetPgParam ¶
func SetSqlServerParam ¶
func SetSqlite3Param ¶
func (*DbMgt) CreateTables ¶
func (*DbMgt) DropTableIfExists ¶
func (*DbMgt) OpenUntilOkAndCreateTables ¶
func (*DbMgt) OpenUntilOkAndDropTableIfExistsThenCreateTables ¶
func (*DbMgt) RegisterAssociationFunc ¶
func (c *DbMgt) RegisterAssociationFunc(funcs ...AssociationFunc) *DbMgt
func (*DbMgt) SetDbParam ¶
func (*DbMgt) SetMysqlParam ¶
func (*DbMgt) SetPgParam ¶
func (*DbMgt) SetSqlServerParam ¶
func (*DbMgt) SetSqlite3Param ¶
Click to show internal directories.
Click to hide internal directories.