Documentation
¶
Index ¶
Constants ¶
View Source
const ( HookBefore = "before" HookAfter = "after" HookError = "error" )
View Source
const ( ErrDatabaseAlreadyExists = errors.String("database already exists") ErrDatabaseNotFound = errors.String("database not found") ErrDatabaseNotOpen = errors.String("database not open") ErrDatabaseNotClosed = errors.String("database not closed") ErrDatabaseNotConnected = errors.String("database not connected") ErrDatabaseNotConnecting = errors.String("database not connecting") )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Context context.Context Debug bool Once bool // use once for close db,when connector used same driver Names []string Connector Connector // use for single database Connectors map[string]Connector // use for multi database, if needed Dialect string // mysql/postgres/sqlite3/... ORM string // gorm,ent,xorm,... DSN string MaxLifetime int MaxIdleTime int MaxOpenConns int MaxIdleConns int Hooks map[string]Hook }
Click to show internal directories.
Click to hide internal directories.