Documentation
¶
Index ¶
- func NewMysqlBackend(host string, port int, user, password, database string, opts ...option) *mysqlBackend
- func NewMysqlBackendWithDB(db *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 ¶ added in v1.4.2
NewMysqlBackendWithDB creates a new MySQL backend using an existing database connection. When using this constructor, the backend will not close the database connection when Close() is called. Migrations are disabled by default; to enable them, use WithApplyMigrations(true) along with WithMigrationDSN to provide a DSN that supports multi-statement queries.
func WithApplyMigrations ¶ added in v0.18.0
func WithApplyMigrations(applyMigrations bool) option
WithApplyMigrations automatically applies database migrations on startup.
func WithBackendOptions ¶ added in v0.18.0
func WithBackendOptions(opts ...backend.BackendOption) option
WithBackendOptions allows to pass generic backend options.
func WithMigrationDSN ¶ added in v1.4.2
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 ¶ added in v0.18.0
Types ¶
This section is empty.