drivertest

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package drivertest is the reusable conformance suite for a TableX Dialect.

Every rule the rest of the application relies on but cannot enforce with a type — quoting that round-trips, placeholders that are consistently positional or consistently numbered, a LIMIT clause that survives a 64-bit offset, and capability flags that agree with the optional interfaces the dialect actually implements — is asserted here once instead of being rediscovered per engine.

A new engine wires itself in with a single call:

func TestConformance(t *testing.T) { drivertest.RunDialectSuite(t, dialect{}) }

or, for the built-in engines, simply by being registered — the suite in internal/driver runs over driver.All(). RunDialectSuite needs no database. RunConnectionSuite is the second half: it needs a live connection and checks that introspection populates the engine-neutral model the handlers read.

See docs/adding-an-engine.md for the full contract.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunConnectionSuite

func RunConnectionSuite(t *testing.T, conn *driver.Connection, scope driver.Scope)

RunConnectionSuite is the half that needs a database. It creates a small table through the dialect's own DDL, introspects it, and asserts the engine-neutral model the handlers read is actually populated — which is the part no amount of pure-function testing can prove.

scope is where the table is created (Database, plus Schema on an engine with schemas). The table is dropped on the way out.

func RunDialectSuite

func RunDialectSuite(t *testing.T, d driver.Dialect)

RunDialectSuite runs every conformance check that needs no database. It is safe to call on the registered (unspecialized) dialect value.

Types

This section is empty.

Jump to

Keyboard shortcuts

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