Documentation
¶
Index ¶
- func NewPostgresBackend(host string, port int, user, password, database string, opts ...option) *postgresBackend
- func NewPostgresBackendWithDB(db *sql.DB, opts ...option) *postgresBackend
- func WithApplyMigrations(applyMigrations bool) option
- func WithBackendOptions(opts ...backend.BackendOption) option
- func WithPostgresOptions(f func(db *sql.DB)) option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewPostgresBackend ¶
func NewPostgresBackendWithDB ¶
NewPostgresBackendWithDB creates a new Postgres backend using an existing database connection. When using this constructor, the backend will not close the database connection when Close() is called. Migrations can still be applied using WithApplyMigrations(true) as Postgres does not require special connection settings for migrations.
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 WithPostgresOptions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.