Help us shape the future of Go! Take the 2026 Go Developer Survey

testdb

package
v1.3.8 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package testdb creates new databases for tests.

Index

Constants

This section is empty.

Variables

This section is empty.

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

Types

This section is empty.

Jump to

Keyboard shortcuts

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