Versions in this module Expand all Collapse all v0 v0.4.7 Dec 21, 2020 v0.4.6 Dec 18, 2020 Changes in this version + const DefaultCockroachURL + const DefaultMySQLURL + func CockroachURLFromEnv() string + func HandleMigrationArgs(mig Migrate) + func MustMigrateUp(mig Migrate) + func MustOpenMigration(driverName, dsn, sourceURL string) *migrate.Migrate + func MySQLURLFromEnv() string + func OpenMigration(driverName, dsn, sourceURL string) (*migrate.Migrate, error) + type Agent interface + type Connector interface + Conn func(ctx context.Context) (*sql.Conn, error) + Driver func() driver.Driver + SetConnMaxLifetime func(d time.Duration) + SetMaxIdleConns func(n int) + SetMaxOpenConns func(n int) + Stats func() sql.DBStats + type DB struct + func MustOpen(driverName, dsn string) *DB + func MustOpenCockroachWithMigration(dsn, sourceURL string) (*DB, *migrate.Migrate) + func MustOpenWithMigrations(driverName, dsn, sourceURL string) (*DB, *migrate.Migrate) + func Open(driverName, dsn string) (*DB, error) + func OpenCockroachWithMigration(dsn, sourceURL string) (*DB, *migrate.Migrate, error) + func OpenWithMigrations(driverName, dsn, sourceURL string) (*DB, *migrate.Migrate, error) + func (db *DB) Check() ([]string, bool) + func (db *DB) MustWait() + func (db *DB) Wait() error + type Executor interface + Exec func(query string, args ...interface{}) (sql.Result, error) + ExecContext func(ctx context.Context, query string, args ...interface{}) (sql.Result, error) + type Migrate interface + Down func() error + Up func() error + type Operator interface + type Pinger interface + Ping func() error + PingContext func(ctx context.Context) error + type Preparer interface + Prepare func(query string) (*sql.Stmt, error) + PrepareContext func(ctx context.Context, query string) (*sql.Stmt, error) + type Querier interface + Query func(query string, args ...interface{}) (*sql.Rows, error) + QueryContext func(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error) + QueryRow func(query string, args ...interface{}) *sql.Row + QueryRowContext func(ctx context.Context, query string, args ...interface{}) *sql.Row + type Transactor interface + Begin func() (*sql.Tx, error) + BeginTx func(ctx context.Context, opts *sql.TxOptions) (*sql.Tx, error)