Help us shape the future of Go! Take the 2026 Go Developer Survey

dialecttest

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package dialecttest is the suite every dialect has to pass.

IT EXISTS BEFORE THE SECOND DIALECT DOES, and that is the reason it exists at all. An interface with one implementation is a description of that implementation; the second one added later agrees with it wherever the author happened to look and differs everywhere else, and the difference is found by whoever pointed a project at the other warehouse. Here it is found by `go test`.

It runs against a REAL warehouse and nothing else. Every claim it makes is about what the server did -- a dialect that returns the right strings and builds the wrong thing passes a test of its strings and fails this one.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeThrowawaySchema added in v0.2.0

func MakeThrowawaySchema(ctx context.Context, d dialect.Dialect, conn dialect.Conn,
	schema string) error

MakeThrowawaySchema creates a schema a TEST will build in, and -- where the warehouse can be told -- makes what lands in it expire.

ONE PLACE, AND IT IS WHY THIS IS EXPORTED FROM A TEST-SUPPORT PACKAGE. Two harnesses create a dataset of their own: this suite, and the runner's incremental test. Two spellings of "and also expire it" is how one of them stops doing it -- the file that is not being edited today.

WHAT IT PROTECTS AGAINST is a harness that never reaches its own cleanup: a panic, a SIGKILL, a laptop that sleeps. `t.Cleanup` runs on a failure and not on any of those, and what is left then sits in a customer's warehouse beside their real data.

It does NOT remove the leak -- BigQuery has no dataset expiry, only one for the tables inside, so a leaked dataset becomes an empty one. That residual is named in dialect.Disposable and is the reason this is six lines rather than a cleanup framework.

THE EXPIRY GOES SECOND AND IMMEDIATELY. It applies to tables created after it, so a helper that set it at the end would leave behind exactly the tables the test built.

func Run

func Run(t *testing.T, d dialect.Dialect, dsn string)

Run is the whole suite. A dialect's own test calls it with a live DSN.

Types

This section is empty.

Directories

Path Synopsis
Command leakprobe is the other half of `scripts/leak-check.sh`: a harness that never cleans up, and the questions you ask BigQuery afterwards.
Command leakprobe is the other half of `scripts/leak-check.sh`: a harness that never cleans up, and the questions you ask BigQuery afterwards.

Jump to

Keyboard shortcuts

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