package testdb
import "github.com/google/trillian/storage/postgres/testdb"
Package testdb creates new databases for tests.
Index ¶
- func NewTrillianDB(ctx context.Context) (*sql.DB, func(context.Context), error)
- func NewTrillianDBOrDie(ctx context.Context) (*sql.DB, func(context.Context))
- func PGAvailable() bool
- func TestSQL(ctx context.Context) string
Functions ¶
func NewTrillianDB ¶
NewTrillianDB creates an empty database with the Trillian schema. The database name is randomly generated. NewTrillianDB is equivalent to Default().NewTrillianDB(ctx).
func NewTrillianDBOrDie ¶
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 ¶
TestSQL executes a simple query in the configured database. Only used as a placeholder for testing queries and how go returns results
Source Files ¶
- Version
- v1.3.7
- Published
- Jan 16, 2020
- Platform
- js/wasm
- Imports
- 11 packages
- Last checked
- 2 hours ago –
Tools for package owners.