dbtest

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2026 License: Apache-2.0 Imports: 43 Imported by: 0

Documentation

Overview

Package dbtest is a conformance suite for db drivers. Each driver module runs it against a real database:

func TestConformance(t *testing.T) {
	d, err := db.Open(sqlite.Driver(), cfg)
	…
	dbtest.Run(t, d)
}

The suite creates and drops its own tables, all named st_*.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(t *testing.T, d *db.DB)

Run runs the suite against d, whose dialect must be postgres, mysql or sqlite.

func RunApp

func RunApp(t *testing.T, drv db.Driver, env map[string]string)

RunApp tests an app using the driver with anetostest: migrations, the test's transaction (seen by requests and validation rules) and its rollback. env holds the DB_* settings for a database that isn't in-memory.

func RunLocalTimeZone added in v0.3.0

func RunLocalTimeZone(t *testing.T, drv db.Driver, cfg db.Config)

RunLocalTimeZone checks a database opened with cfg, whose connection string sets a session time zone other than UTC: db.DB.Check refuses it, naming the zone, unless cfg allows local time zones.

Types

This section is empty.

Jump to

Keyboard shortcuts

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