testdb

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package testdb provides guarded, schema-isolated PostgreSQL databases for integration tests and benchmarks. It is internal so applications cannot accidentally depend on test provisioning behavior.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Schema

type Schema struct {
	Driver       store.Driver
	DatabaseName string
	Name         string
	// contains filtered or unexported fields
}

func OpenPostgreSQLSchema

func OpenPostgreSQLSchema(ctx context.Context, rawURL, requiredDatabaseSuffix, prefix string) (*Schema, error)

OpenPostgreSQLSchema creates a random schema after verifying that the target database name has the required test/benchmark suffix. This prevents an accidental environment variable from targeting a production database.

func (*Schema) Close

func (schema *Schema) Close() error

Jump to

Keyboard shortcuts

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