testdb

package
v3.11.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 10, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// https://hub.docker.com/r/clickhouse/clickhouse-server/
	CLICKHOUSE_IMAGE   = "clickhouse/clickhouse-server"
	CLICKHOUSE_VERSION = "22.9-alpine"

	CLICKHOUSE_DB                        = "clickdb"
	CLICKHOUSE_USER                      = "clickuser"
	CLICKHOUSE_PASSWORD                  = "password1"
	CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT = "1"
)
View Source
const (
	ClickHousePort     = "9000/tcp"
	ClickhouseHTTPPort = "8123/tcp"
)
View Source
const (
	// https://hub.docker.com/_/mariadb
	MARIADB_IMAGE   = "mariadb"
	MARIADB_VERSION = "10"

	MARIADB_DB       = "testdb"
	MARIADB_USER     = "tester"
	MARIADB_PASSWORD = "password1"
)
View Source
const (
	// https://hub.docker.com/_/postgres
	POSTGRES_IMAGE   = "postgres"
	POSTGRES_VERSION = "14-alpine"

	POSTGRES_DB       = "testdb"
	POSTGRES_USER     = "postgres"
	POSTGRES_PASSWORD = "password1"
)
View Source
const (
	// https://hub.docker.com/r/vertica/vertica-ce
	VERTICA_IMAGE   = "vertica/vertica-ce"
	VERTICA_VERSION = "23.3.0-0"
	VERTICA_DB      = "testdb"
)
View Source
const (
	YDB_IMAGE    = "ghcr.io/ydb-platform/local-ydb"
	YDB_VERSION  = "23.3"
	YDB_PORT     = "2136"
	YDB_UI_PORT  = "8765"
	YDB_DATABASE = "local"
)

Variables

View Source
var (
	// DB_HOST is the hostname where ClickHouse is running
	// localhost for local runs and docker for CI runs
	DB_HOST string
)

Functions

func CreateClickHouseContainer

func CreateClickHouseContainer(ctx context.Context, configPath string) (testcontainers.Container, error)

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.

func NewVertica

func NewVertica(options ...OptionsFunc) (db *sql.DB, cleanup func(), err error)

NewVertica starts a Vertica docker container. Returns a db connection and a docker cleanup function.

func NewYdb added in v3.11.5

func NewYdb(options ...OptionsFunc) (db *sql.DB, cleanup func(), err error)

NewYdb starts a YDB docker container. Returns db connection and a docker cleanup function.

func OpenClickhouse

func OpenClickhouse(endpoint string, debug bool) (*sql.DB, error)

Types

type OptionsFunc

type OptionsFunc func(o *options)

func WithBindPort

func WithBindPort(n int) OptionsFunc

func WithDebug

func WithDebug(b bool) OptionsFunc

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL