testdb

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package testdb hands tests an isolated database configuration.

Default backend is a throwaway SQLite file. Set KY_TEST_POSTGRES_DSN to run the same tests against a real Postgres instance; each caller gets its own schema, dropped on cleanup.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Config

func Config(t *testing.T) config.DatabaseConfig

Config returns a database config pointing at an isolated, empty database.

func DatabaseConfig added in v0.5.0

func DatabaseConfig(t *testing.T) config.DatabaseConfig

DatabaseConfig owns the whole database when a test measures database-wide disk usage. A schema cannot isolate pg_database_size from other fixtures. PostgreSQL test credentials need CREATEDB; production never calls this helper.

Types

This section is empty.

Jump to

Keyboard shortcuts

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