Module db

Module db 

Source
Expand description

Database provisioning for tests.

Provides PostgreSQL access for integration tests. Database configuration options:

  1. Pass a URL directly via from_url()
  2. Use from_env() to explicitly read from TEST_DATABASE_URL
  3. Use embedded() for automatic embedded PostgreSQL (requires embedded-db feature)

This design prevents accidental use of production databases. The .env file DATABASE_URL is NEVER automatically read.

Structsยง

IsolatedTestDb
A test database that exists for the lifetime of a single test.
TestDatabase
Database access for tests.