Documentation ¶
Overview ¶
Package testdbpgx creates new PostgreSQL databases for tests.
Index ¶
Constants ¶
View Source
const ( // PostgreSQLURIEnv is the name of the ENV variable checked for the test PostgreSQL // instance URI to use. The value must have a trailing slash. PostgreSQLURIEnv = "TEST_POSTGRESQL_URI" )
Variables ¶
This section is empty.
Functions ¶
func NewTrillianDB ¶
func NewTrillianDB(ctx context.Context, driver DriverName) (*pgxpool.Pool, 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 PostgreSQLAvailable ¶
func PostgreSQLAvailable() bool
PostgreSQLAvailable indicates whether the configured PostgreSQL database is available.
func SetFDLimit ¶
SetFDLimit sets the soft limit on the maximum number of open file descriptors. See http://man7.org/linux/man-pages/man2/setrlimit.2.html
func SkipIfNoPostgreSQL ¶
SkipIfNoPostgreSQL is a test helper that skips tests that require a local PostgreSQL.
Types ¶
type DriverName ¶
type DriverName string
DriverName is the name of a database driver.
const ( // DriverPostgreSQL is the identifier for the PostgreSQL storage driver. DriverPostgreSQL DriverName = "postgresql" )
Click to show internal directories.
Click to hide internal directories.