package testdb

import "github.com/google/trillian/storage/postgres/testdb"

Package testdb creates new databases for tests.

Index

Functions

func NewTrillianDB

func NewTrillianDB(ctx context.Context) (*sql.DB, func(context.Context), error)

NewTrillianDB creates an empty database with the Trillian schema. The database name is randomly generated. NewTrillianDB is equivalent to Default().NewTrillianDB(ctx).

func NewTrillianDBOrDie

func NewTrillianDBOrDie(ctx context.Context) (*sql.DB, func(context.Context))

NewTrillianDBOrDie attempts to return a connection to a new postgres test database and fails if unable to do so.

func PGAvailable

func PGAvailable() bool

PGAvailable indicates whether a default PG database is available.

func TestSQL

func TestSQL(ctx context.Context) string

TestSQL executes a simple query in the configured database. Only used as a placeholder for testing queries and how go returns results

Source Files

testdb.go

Version
v1.3.7
Published
Jan 16, 2020
Platform
js/wasm
Imports
11 packages
Last checked
2 hours ago

Tools for package owners.