Versions in this module Expand all Collapse all v1 v1.0.0 Jul 17, 2018 Changes in this version + const DefaultMaxOpenConn + func CopyDBResources(input, output DB, overrideExisting bool) error + func GetRetryInterval(retryInterval time.Duration) time.Duration + func InitDBConnWithSchemas(aDb DB, initDBParams InitDBParams) error + func InitDBWithSchemas(dbType, dbConnection string, initDBParams InitDBParams) error + func IsDeadlock(err error) bool + func Within(db DB, fn func(transaction.Transaction) error) error + func WithinTemplate(retries int, retryStrategy func() time.Duration, ...) error + func WithinTx(ctx context.Context, db DB, options *transaction.TxOptions, ...) error + type DB interface + Begin func() (transaction.Transaction, error) + BeginTx func(ctx context.Context, options *transaction.TxOptions) (transaction.Transaction, error) + Close func() + Connect func(string, string, int) error + DropTable func(*schema.Schema) error + Options func() options.Options + RegisterTable func(s *schema.Schema, cascade, migrate bool) error + func ConnectDB(dbType, conn string, maxOpenConn int, opt options.Options) (DB, error) + func CreateFromConfig(config *util.Config) (DB, error) + type ITransaction interface + Close func() error + Closed func() bool + Commit func() error + type InitDBParams struct + AllowEmpty bool + AutoMigrate bool + Cascade bool + DropOnCreate bool + func DefaultTestInitDBParams() InitDBParams