An ephemeral database for a test group or suite.
Backends differ: PostgreSQL is created empty on the project postmaster; SQLite records a per-group file path (the file appears when the server migrates). Callers apply schema and decide whether to drop.
Properties
Methods
-
drop(
) → Future< void> -
Tears down this database:
DROP DATABASEfor PostgreSQL, or deleting the SQLite file and its WAL/SHM/journal sidecars. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
create(
{required String runMode, required String databaseName, required Directory serverDirectory, ServerpodConfig configOverride(ServerpodConfig)?}) → Future< EphemeralTestDatabase?> - Provisions an ephemeral database for the project's configured backend.
-
resolveProjectDatabaseConfig(
{required String runMode, String? serverDirectory, ServerpodConfig configOverride(ServerpodConfig)?}) → DatabaseConfig? -
Loads the project's database config the way
Serverpodwould (run mode, passwords, and an optionalconfigOverride) but without any per-test name swap, so the shared postmaster is launched against the project database. -
sqliteFilePath(
String original, String databaseName) → String -
Per-group SQLite file path derived from
originalby insertingdatabaseName(e.g.db/test.db→db/sp_test_<token>.db). Relative paths stay relative so the SQLite adapter can anchor them against the server directory.