Documentation
¶
Overview ¶
Package pgtest gives the tests a PostgreSQL database of their own, on the server of XTRADER_TEST_DATABASE_URL, eg: a container of postgres:18.6: the tests are skipped without it.
Index ¶
Constants ¶
const Env = "XTRADER_TEST_DATABASE_URL"
Env is the variable of the URL of the server of the tests, of a user allowed to create databases.
Variables ¶
This section is empty.
Functions ¶
func Database ¶
Database creates an empty database for the test, dropped at its end, and returns its URL.
func Migrate ¶
Migrate applies the migrations and the seeds of the repository at root to the database of dsn. The agents the seeds add (sql/seeds/0004_agents.sql) are taken out again, the tests starting without any: the ones there before are kept. MigrateSeeded keeps them.
func MigrateSeeded ¶
MigrateSeeded is Migrate keeping the agents of the seeds.
Types ¶
This section is empty.