testdb

package
v0.0.0-...-51ec7a6 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package testdb provides schema-isolated PostgreSQL databases to Soro tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Open

func Open(t testing.TB) *database.DB

func OpenRuntime

func OpenRuntime(t testing.TB, maxConns int32, setup RuntimeSetup) *database.DB

OpenRuntime opens a pool using the distinct non-privileged role configured by SORO_TEST_RUNTIME_DATABASE_URL. The admin URL provisions and removes an isolated schema before the runtime role connects.

Types

type RuntimeSetup

type RuntimeSetup func(context.Context, *pgx.Conn, string, string) error

RuntimeSetup provisions runtime-role fixtures using the administrative connection. Runtime tests must not let the application role own RLS tables.

Jump to

Keyboard shortcuts

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