Documentation
¶
Index ¶
- func NewMysqlBackend(host string, port int, user, password, database string, opts ...option) *mysqlBackend
- func NewMysqlBackendWithDB(pool *sql.DB, opts ...option) *mysqlBackend
- func WithApplyMigrations(applyMigrations bool) option
- func WithBackendOptions(opts ...backend.BackendOption) option
- func WithMigrationDSN(dsn string) option
- func WithMySQLOptions(f func(db *sql.DB)) option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMysqlBackend ¶
func NewMysqlBackendWithDB ¶
NewMysqlBackendWithDB leaves connection configuration and ownership with the caller. Automatic migrations require WithMigrationDSN and are disabled by default.
func WithApplyMigrations ¶
func WithApplyMigrations(applyMigrations bool) option
WithApplyMigrations automatically applies database migrations on startup.
func WithBackendOptions ¶
func WithBackendOptions(opts ...backend.BackendOption) option
WithBackendOptions allows to pass generic backend options.
func WithMigrationDSN ¶
func WithMigrationDSN(dsn string) option
WithMigrationDSN sets the DSN to use for running migrations. This is required when using NewMysqlBackendWithDB with ApplyMigrations enabled. The DSN should support multi-statement queries.
func WithMySQLOptions ¶
Types ¶
This section is empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package db owns mysql connection setup and the backend's immutable migration history.
|
Package db owns mysql connection setup and the backend's immutable migration history. |
Click to show internal directories.
Click to hide internal directories.