Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AdminPool ¶
AdminPool opens the owner-role connection — the same role that runs migrations. For tests that must perform DDL, e.g. replaying a shipped migration's data transform against a seeded pre-migration shape (the app role can't drop/recreate indexes it doesn't own).
func CreateTestTenant ¶
CreateTestTenant inserts a tenant via the app connection (bypass RLS). Since tenants table has no RLS, this works directly.
func TestCtx ¶
TestCtx returns a context with livemode pinned to false (test mode) — matching the partition every integration test fixture inserts against. Tests that go through the auth middleware in production would inherit livemode from the API key; tests that hit stores or services directly need to pin it explicitly, otherwise BeginTx trips the strict-mode panic ("TxTenant opened without ctx livemode") and silently routes to live in non-strict builds.
Default: livemode=false (test). For live-mode integration tests, wrap context.Background() with postgres.WithLivemode(ctx, true) directly — those are rare enough not to warrant a separate helper.
Types ¶
This section is empty.