package testdb
import "github.com/pressly/goose/v3/internal/testdb"
Index ¶
- Constants
- func NewClickHouse(options ...OptionsFunc) (db *sql.DB, cleanup func(), err error)
- func NewMariaDB(options ...OptionsFunc) (db *sql.DB, cleanup func(), err error)
- func NewPostgres(options ...OptionsFunc) (db *sql.DB, cleanup func(), err error)
- type OptionsFunc
Constants ¶
const ( // https://hub.docker.com/r/clickhouse/clickhouse-server/ CLICKHOUSE_IMAGE = "clickhouse/clickhouse-server" CLICKHOUSE_VERSION = "22-alpine" CLICKHOUSE_DB = "clickdb" CLICKHOUSE_USER = "clickuser" CLICKHOUSE_PASSWORD = "password1" CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT = "1" )
const ( // https://hub.docker.com/_/mariadb MARIADB_IMAGE = "mariadb" MARIADB_VERSION = "10" MARIADB_DB = "testdb" MARIADB_USER = "tester" MARIADB_PASSWORD = "password1" )
const ( // https://hub.docker.com/_/postgres POSTGRES_IMAGE = "postgres" POSTGRES_VERSION = "14-alpine" POSTGRES_DB = "testdb" POSTGRES_USER = "postgres" POSTGRES_PASSWORD = "password1" )
Functions ¶
func NewClickHouse ¶
func NewClickHouse(options ...OptionsFunc) (db *sql.DB, cleanup func(), err error)
NewClickHouse starts a ClickHouse docker container. Returns db connection and a docker cleanup function.
func NewMariaDB ¶
func NewMariaDB(options ...OptionsFunc) (db *sql.DB, cleanup func(), err error)
NewMariaDB starts a MariaDB docker container. Returns a db connection and a docker cleanup function.
func NewPostgres ¶
func NewPostgres(options ...OptionsFunc) (db *sql.DB, cleanup func(), err error)
NewPostgres starts a PostgreSQL docker container. Returns db connection and a docker cleanup function.
Types ¶
type OptionsFunc ¶
type OptionsFunc func(o *options)
func WithBindPort ¶
func WithBindPort(n int) OptionsFunc
func WithDebug ¶
func WithDebug(b bool) OptionsFunc
Source Files ¶
clickhouse.go mariadb.go options.go postgres.go testdb.go
- Version
- v3.6.1
- Published
- Jun 23, 2022
- Platform
- linux/amd64
- Imports
- 9 packages
- Last checked
- 3 hours ago –
Tools for package owners.