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 `long:"postgres" default:"postgres://postgres:postgres@localhost:5432?sslmode=disable" description:"Postgres server url."` PoolSize int `` /* 133-byte string literal not displayed */ EnableQueryLogging bool `long:"enable-query-logging" description:"Enable query logging."` ConnectionLifetime time.Duration `long:"postgres-lifetime" default:"10m" description:"Maximum time a connection in the pool can be used."` 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.