Documentation ¶
Index ¶
- Constants
- func CreateInsertSql(tableName string, kv map[string]interface{}) (sql string, values []interface{})
- func Expr(expr string, args ...interface{}) clause.Expr
- func Get() *gorm.DB
- func GetWithContext(ctx context.Context) *gorm.DB
- func InitDataSource(option option.Option, dialector Dialector) *gorm.DB
- func InitDefault(dialector Dialector)
- func InitDefaultWithOption(option option.Option, dialector Dialector)
- func IsDuplicatedKeyError(err error) bool
- func Transaction(ctx context.Context, fc func(txctx context.Context) error) error
- type Dialector
Constants ¶
View Source
const ( DB_DSN = "datasource.dsn" DB_URL_KEY = "datasource.url" DB_USERNAME_KEY = "datasource.username" DB_PWD_KEY = "datasource.password" DB_CONN_MAX_LIFE_TIME = "datasource.connMaxLifetime" DB_MAX_IDLE_CONNS = "datasource.maxIdleConns" DB_MAX_OPEN_CONNS = "datasource.maxOpenConns" DB_QueryFields = "datasource.queryFields" DB_TYPE = "datasource.type" DefaultConnMaxLifetime = 30 * time.Minute DefaultMaxIdleConns = 10 DefaultMaxOpenConns = 50 DB_TYPE_MYSQL = "mysql" )
Variables ¶
This section is empty.
Functions ¶
func CreateInsertSql ¶
func InitDefaultWithOption ¶
func IsDuplicatedKeyError ¶ added in v0.9.3
Types ¶
Click to show internal directories.
Click to hide internal directories.