package tests
import "github.com/ClickHouse/clickhouse-go/v2/tests"
Index ¶
- Variables
- func BuildTestJSONPaths() *chcol.JSON
- func CheckMinServerServerVersion(conn driver.Conn, major, minor, patch uint64) bool
- func ClientOptionsFromEnv(env ClickHouseTestEnvironment, settings clickhouse.Settings, useHTTP bool) clickhouse.Options
- func CreateDatabase(testSet string) error
- func GetClickHouseTestVersion() string
- func GetConnection(testSet string, settings clickhouse.Settings, tlsConfig *tls.Config, compression *clickhouse.Compression) (driver.Conn, error)
- func GetConnectionWithOptions(options *clickhouse.Options) (driver.Conn, error)
- func GetEnv(key, fallback string) string
- func IsSetInEnv(key string) bool
- func OptionsToDSN(o *clickhouse.Options) string
- func PrintMemUsage()
- func RandAsciiString(n int) string
- func RandIPv4() net.IP
- func RandIPv6() net.IP
- func RandIntString(n int) string
- func ResetRandSeed()
- func Runtime(m *testing.M, ts string) (exitCode int)
- func SetTestEnvironment(testSet string, environment ClickHouseTestEnvironment)
- func SkipOnCloud(t *testing.T, reasons ...string)
- func TestClientDefaultSettings(env ClickHouseTestEnvironment) clickhouse.Settings
- func TestClientWithDefaultOptions(env ClickHouseTestEnvironment, settings clickhouse.Settings) (driver.Conn, error)
- func TestClientWithDefaultSettings(env ClickHouseTestEnvironment) (driver.Conn, error)
- func TestDatabaseSQLClientWithDefaultOptions(env ClickHouseTestEnvironment, settings clickhouse.Settings) (*sql.DB, error)
- func TestDatabaseSQLClientWithDefaultSettings(env ClickHouseTestEnvironment) (*sql.DB, error)
- type ClickHouseTestEnvironment
- func CreateClickHouseTestEnvironment(testSet string) (ClickHouseTestEnvironment, error)
- func GetExternalTestEnvironment(testSet string) (ClickHouseTestEnvironment, error)
- func GetTestEnvironment(testSet string) (ClickHouseTestEnvironment, error)
- type FastTestStruct
- func BuildFastTestJSONStruct() FastTestStruct
- func (fts *FastTestStruct) DeserializeClickHouseJSON(obj *clickhouse.JSON) error
- func (fts *FastTestStruct) SerializeClickHouseJSON() (*clickhouse.JSON, error)
- type NginxReverseHTTPProxyTestEnvironment
- type TestStruct
- type TestStructAddress
- type TinyProxyTestEnvironment
Variables ¶
var CloudClickHouse = false
var LocalClickHouse = false
var RemoteClickHouse = false
Functions ¶
func BuildTestJSONPaths ¶
func CheckMinServerServerVersion ¶
func ClientOptionsFromEnv ¶
func ClientOptionsFromEnv(env ClickHouseTestEnvironment, settings clickhouse.Settings, useHTTP bool) clickhouse.Options
func CreateDatabase ¶
func GetClickHouseTestVersion ¶
func GetClickHouseTestVersion() string
func GetConnection ¶
func GetConnection(testSet string, settings clickhouse.Settings, tlsConfig *tls.Config, compression *clickhouse.Compression) (driver.Conn, error)
func GetConnectionWithOptions ¶
func GetEnv ¶
func IsSetInEnv ¶
func OptionsToDSN ¶
func OptionsToDSN(o *clickhouse.Options) string
func PrintMemUsage ¶
func PrintMemUsage()
PrintMemUsage outputs the current, total and OS memory being used. As well as the number of garage collection cycles completed. thanks to https://golangcode.com/print-the-current-memory-usage/
func RandAsciiString ¶
func RandIPv4 ¶
func RandIPv6 ¶
func RandIntString ¶
func ResetRandSeed ¶
func ResetRandSeed()
func Runtime ¶
func SetTestEnvironment ¶
func SetTestEnvironment(testSet string, environment ClickHouseTestEnvironment)
func SkipOnCloud ¶
func TestClientDefaultSettings ¶
func TestClientDefaultSettings(env ClickHouseTestEnvironment) clickhouse.Settings
func TestClientWithDefaultOptions ¶
func TestClientWithDefaultOptions(env ClickHouseTestEnvironment, settings clickhouse.Settings) (driver.Conn, error)
func TestClientWithDefaultSettings ¶
func TestClientWithDefaultSettings(env ClickHouseTestEnvironment) (driver.Conn, error)
func TestDatabaseSQLClientWithDefaultOptions ¶
func TestDatabaseSQLClientWithDefaultOptions(env ClickHouseTestEnvironment, settings clickhouse.Settings) (*sql.DB, error)
func TestDatabaseSQLClientWithDefaultSettings ¶
func TestDatabaseSQLClientWithDefaultSettings(env ClickHouseTestEnvironment) (*sql.DB, error)
Types ¶
type ClickHouseTestEnvironment ¶
type ClickHouseTestEnvironment struct { ContainerID string Port int HttpPort int SslPort int HttpsPort int Host string Username string Password string Database string Version proto.Version ContainerIP string Container testcontainers.Container `json:"-"` }
func CreateClickHouseTestEnvironment ¶
func CreateClickHouseTestEnvironment(testSet string) (ClickHouseTestEnvironment, error)
func GetExternalTestEnvironment ¶
func GetExternalTestEnvironment(testSet string) (ClickHouseTestEnvironment, error)
func GetTestEnvironment ¶
func GetTestEnvironment(testSet string) (ClickHouseTestEnvironment, error)
type FastTestStruct ¶
type FastTestStruct struct {
// contains filtered or unexported fields
}
FastTestStruct is a distinctly separate type that implements clickhouse.JSONSerializer and clickhouse.JSONDeserializer The struct must be a separate type since the JSON column is unable to ignore the interface implementation.
func BuildFastTestJSONStruct ¶
func BuildFastTestJSONStruct() FastTestStruct
func (*FastTestStruct) DeserializeClickHouseJSON ¶
func (fts *FastTestStruct) DeserializeClickHouseJSON(obj *clickhouse.JSON) error
DeserializeClickHouseJSON implements clickhouse.JSONDeserializer for faster struct scanning
func (*FastTestStruct) SerializeClickHouseJSON ¶
func (fts *FastTestStruct) SerializeClickHouseJSON() (*clickhouse.JSON, error)
SerializeClickHouseJSON implements clickhouse.JSONSerializer for faster struct appending
type NginxReverseHTTPProxyTestEnvironment ¶
type NginxReverseHTTPProxyTestEnvironment struct { HttpPort int NginxContainer testcontainers.Container `json:"-"` }
func CreateNginxReverseProxyTestEnvironment ¶
func CreateNginxReverseProxyTestEnvironment(clickhouseEnv ClickHouseTestEnvironment) (NginxReverseHTTPProxyTestEnvironment, error)
type TestStruct ¶
type TestStruct struct { Name string Age int64 Active bool Score float64 Tags []string Numbers []int64 Address TestStructAddress KeysNumbers map[string]int64 Metadata map[string]interface{} Timestamp time.Time `chType:"DateTime64(3)"` DynamicString chcol.Dynamic DynamicInt chcol.Dynamic DynamicMap chcol.Dynamic }
func BuildTestJSONStruct ¶
func BuildTestJSONStruct() TestStruct
type TestStructAddress ¶
type TestStructAddress struct { Street string `chType:"String"` City string `chType:"String"` Country string `chType:"String"` }
type TinyProxyTestEnvironment ¶
type TinyProxyTestEnvironment struct { HttpPort int Container testcontainers.Container `json:"-"` }
func CreateTinyProxyTestEnvironment ¶
func CreateTinyProxyTestEnvironment(t *testing.T) (TinyProxyTestEnvironment, error)
func (TinyProxyTestEnvironment) ProxyUrl ¶
func (e TinyProxyTestEnvironment) ProxyUrl(t *testing.T) string
Source Files ¶
json_helper.go package.go utils.go
Directories ¶
Path | Synopsis |
---|---|
tests/issues | |
tests/issues/209 | |
tests/issues/360 | |
tests/issues/470 | |
tests/issues/476 | |
tests/issues/484 | |
tests/issues/485 | |
tests/std | |
tests/stress |
- Version
- v2.34.0 (latest)
- Published
- Apr 1, 2025
- Platform
- js/wasm
- Imports
- 31 packages
- Last checked
- 28 minutes ago –
Tools for package owners.