dbtest

package
v1.53.12 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: MIT Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package dbtest runs a test on both engines the engine's shared database can be on.

SQLite always runs. PostgreSQL runs when TASKS_TEST_SQL_DSN names a server whose role may create databases (cloud's scripts/postgres.sh starts one, and exports it as CLOUD_TEST_SQL_DSN); without it the postgres subtest is a visible skip.

The body is handed a function that opens a handle on the test's database. Each call is a pool of its own onto the same rows, which is what a replica is: two pods do not share a pool, they share a server.

Index

Constants

View Source
const Env = "TASKS_TEST_SQL_DSN"

Env names the PostgreSQL server the postgres leg runs on.

Variables

This section is empty.

Functions

func Engines

func Engines(t *testing.T, body func(t *testing.T, open Open))

Engines runs body once per engine, each as a subtest, on a database of its own.

Types

type Open

type Open func() *sql.DB

Open opens a handle on the database of the test, closed when the test ends.

Jump to

Keyboard shortcuts

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