Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopyInterface ¶ added in v1.0.0
func CopyInterface(dst interface{}, src interface{}) (err error)
func RegisteredDrivers ¶ added in v1.0.0
func RegisteredDrivers() (drivers []string)
Types ¶
type Config ¶
type Config struct {
Driver string `json:"driver"`
MasterSlaverMode bool `json:"masterSlaverMode"`
DSN []string `json:"dsn"`
MaxIdles int `json:"maxIdles"`
MaxOpens int `json:"maxOpens"`
EnableDebugLog bool `json:"enableDebugLog"`
TransactionMaxAliveDuration string `json:"transactionMaxAliveDuration"`
GTMCleanUpSecond int `json:"gtmCleanUpSecond"`
Isolation int `json:"isolation"`
Dialect string `json:"dialect"`
}
type Database ¶
type Database interface {
service.Component
Dialect() (name string)
BeginTransaction(ctx context.Context) (err errors.CodeError)
CommitTransaction(ctx context.Context) (finished bool, err errors.CodeError)
RollbackTransaction(ctx context.Context) (err errors.CodeError)
Query(ctx context.Context, query string, args []interface{}) (rows *sql.Rows, err errors.CodeError)
Execute(ctx context.Context, query string, args []interface{}) (result sql.Result, err errors.CodeError)
}
type GlobalTransaction ¶
type GlobalTransaction struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.