pub fn db_fixture() -> DbUrlExpand description
A convenience function for regular applications.
Some applications just need a clean database instance and can afford to share the underlying database.
If the PGDB_TESTS_URL environment variable is set, it will be used as an external database
URL instead of creating a local instance. The URL must include superuser credentials. A new
database will be created for each call, just like with local instances.
Otherwise, uses a shared database instance if multiple tests are running at the same time (see
DbUrl for details). The database may be shut down and recreated if the last DbUrl is
dropped during testing, e.g. when parallel tests are not spawned quick enough.
This construction is necessary because static variables will not have Drop called on them,
without this construction, the spawned Postgres server would not be stopped.