WasmDatabase.opened constructor
WasmDatabase.opened(
- CommonDatabase database, {
- bool logStatements = false,
- WasmDatabaseSetup? setup,
- bool closeUnderlyingOnClose = true,
- bool enableMigrations = true,
- bool cachePreparedStatements = true,
Creates a drift executor for an opened database from the sqlite3
package.
When the closeUnderlyingOnClose argument is set (which is the default),
calling QueryExecutor.close on the returned WasmDatabase will also
CommonDatabase.dispose the database passed to this constructor.
Using WasmDatabase.opened may be useful when you want to use the same
underlying CommonDatabase in multiple drift connections. Drift uses this
internally when running integration tests for migrations.
Implementation
factory WasmDatabase.opened(
CommonDatabase database, {
bool logStatements = false,
WasmDatabaseSetup? setup,
bool closeUnderlyingOnClose = true,
bool enableMigrations = true,
bool cachePreparedStatements = true,
}) {
return WasmDatabase._(
_WasmDelegate.opened(database, setup, closeUnderlyingOnClose,
cachePreparedStatements, enableMigrations),
logStatements,
);
}