local

package
v0.0.0-...-3ad8b20 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package local creates a database per test on the servers the examples for ClickHouse, SQL Server and Spanner run against, named by environment variable, and skips the test when none is named. The helpers for PostgreSQL, MySQL and SQLite live in the main module's internal/sqltest, which the rest of sqlc's tests share; these live with the examples so the drivers they need are dependencies of the examples module alone.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClickHouse

func ClickHouse(t *testing.T, migrations []string) string

ClickHouse creates a database on the server CLICKHOUSE_SERVER_URI names, such as clickhouse://default:mysecretpassword@127.0.0.1:9000, runs the migrations in it and returns a URI that connects to it. The test is skipped when no server is named.

func MSSQL

func MSSQL(t *testing.T, migrations []string) string

MSSQL creates a database on the server MSSQL_SERVER_URI names, such as sqlserver://sa:Mysecretpassword1!@127.0.0.1:1433?encrypt=disable, runs the migrations in it and returns a URI that connects to it. The test is skipped when no server is named.

func Spanner

func Spanner(t *testing.T, migrations []string) string

Spanner creates a database on the Spanner Omni server SPANNER_SERVER_URI names by its gRPC endpoint, such as localhost:15000, runs the migrations as its DDL and returns a data source name for the go-sql-spanner driver that connects to it without TLS or credentials, as Omni is reached. The test is skipped when no server is named.

Types

This section is empty.

Jump to

Keyboard shortcuts

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