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.
Click to show internal directories.
Click to hide internal directories.