Documentation ¶
Overview ¶
Package pgtest provides simple utility functions for creating temporary databases in PostgreSQL. It was designed to be used in integration tests in the following way:
func TestSomethingThatUsesPostgres(t *testing.T) { // create pool and schedule cleanup function pool, cleanup := pgtest.PrepareWithSchema(t, "../storage/schema/schema.sql") defer cleanup() // use pool in your code accountID := prepareTestAccount(t, pool) ... }
It's not production ready and was specifically tailored for spendshelf-backend requirements.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.