Documentation
¶
Overview ¶
Package chtest creates isolated ClickHouse databases for tests, mirroring internal/pgtest.
ClickHouse has no search_path, so where pgtest isolates a test in a schema on a shared database, chtest isolates it in a database of its own on the shared server.
Index ¶
Constants ¶
const ( Addr = "127.0.0.1:9010" User = "default" Password = "hunter2" )
Addr is the local ClickHouse from docker-compose.yml. The native port is 9010 rather than 9000 so it can coexist with another project's ClickHouse.
Variables ¶
This section is empty.
Functions ¶
func NewClickHouseDB ¶
NewClickHouseDB opens a connection to a randomly named, new database and runs all sqlFiles against it.
func NewClickHouseDBString ¶
NewClickHouseDBString opens a connection to a randomly named, new database and runs the statements in sql against it. Statements are separated by semicolons: ClickHouse has no multi-statement Exec. It also returns the DSN for that database, for tests that drive pggen through its public API.
func Options ¶
func Options(database string) *clickhouse.Options
Options returns the connection options for the local test ClickHouse, pointed at database.
Types ¶
This section is empty.