package dbtest
Import Path
golang.org/x/pkgsite/internal/testing/dbtest (on go.dev)
Dependency Relation
imports 10 packages, and imported by one package
Involved Source Files
Package dbtest supports testing with a database.
Package-Level Type Names (only one, which is exported)
Package-Level Functions (total 7, in which 5 are exported)
ConnectAndExecute connects to the postgres database specified by uri and
executes dbFunc, then cleans up the database connection.
It returns an error that Is derrors.NotFound if no connection could be made.
CreateDB creates a new database dbName.
CreateDBIfNotExists checks whether the given dbName is an existing database,
and creates one if not.
DBConnURI generates a postgres connection string in URI format. This is
necessary as migrate expects a URI.
DropDB drops the database named dbName.
![]() |
The pages are generated with Golds v0.3.2-preview. (GOOS=darwin GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |