Skip to main content

testdb

Function testdb 

Source
pub fn testdb() -> Backend
Expand description

Constructs the default Backend struct for testing, with the test database’s schema brought current.

The test DB self-migrates from the embedded migrations (once per test process) — the same source cortex init applies to production — so keeping it current needs no diesel_cli. A stale test DB otherwise surfaces as relation "..." does not exist deep inside an unrelated assertion, which reads like a code bug rather than an un-migrated database. Only database.test_url is ever reached, never database.url.