Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrIsUniqueViolation ¶
func InstallTracer ¶ added in v2.2.106
func InstallTracer(tracer Tracer)
Types ¶
type Initializer ¶
func DefaultMigration ¶
func DefaultMigration(table string) Initializer
DefaultMigration creates an Initializer that performs a database migration by looking for sql files in the default directories.
func Migration ¶
func Migration(table, directory string) Initializer
Migration Runs a migration with the sql files from the given directory. The directory must exist. The migration library will use the given table name to store the migration progress
type PostgresOptions ¶
type PostgresOptions struct {
URL string `` /* 135-byte string literal not displayed */
PoolSize int `` /* 153-byte string literal not displayed */
EnableQueryLogging bool `long:"enable-query-logging" env:"ENABLE_QUERY_LOGGING" description:"Enable query logging."`
ConnectionLifetime time.Duration `` /* 127-byte string literal not displayed */
Inputs struct {
// An optional initializer. This might be used to do
// database migration or stuff.
Initializer Initializer
}
// contains filtered or unexported fields
}
func (*PostgresOptions) Connection ¶
func (opts *PostgresOptions) Connection() *sqlx.DB
type Tracer ¶ added in v2.2.106
Click to show internal directories.
Click to hide internal directories.