diff --git a/moor/lib/src/ffi/vm_database.dart b/moor/lib/src/ffi/vm_database.dart index 217661f5..18a237a0 100644 --- a/moor/lib/src/ffi/vm_database.dart +++ b/moor/lib/src/ffi/vm_database.dart @@ -15,7 +15,8 @@ import 'moor_ffi_functions.dart'; /// implementations. typedef DatabaseSetup = void Function(Database database); -/// A moor database that runs on the Dart VM. +/// A moor database implementation based on `dart:ffi`, running directly in a +/// Dart VM or an AOT compiled Dart/Flutter application. class VmDatabase extends DelegatedDatabase { VmDatabase._(DatabaseDelegate delegate, bool logStatements) : super(delegate, isSequential: true, logStatements: logStatements); @@ -51,6 +52,10 @@ class VmDatabase extends DelegatedDatabase { /// calling [QueryExecutor.close] on the returned [VmDatabase] will also /// [Database.dispose] the [database] passed to this constructor. /// + /// Using [VmDatabase.opened] may be useful when you want to use the same + /// underlying [Database] in multiple moor connections. Moor uses this + /// internally when running [integration tests for migrations](https://moor.simonbinder.eu/docs/advanced-features/migrations/#verifying-migrations). + /// /// {@macro moor_vm_database_factory} factory VmDatabase.opened(Database database, {bool logStatements = false, diff --git a/moor_generator/lib/src/services/schema/verifier_impl.dart b/moor_generator/lib/src/services/schema/verifier_impl.dart index 83424f66..e2a87601 100644 --- a/moor_generator/lib/src/services/schema/verifier_impl.dart +++ b/moor_generator/lib/src/services/schema/verifier_impl.dart @@ -75,7 +75,7 @@ class VerifierImplementation implements SchemaVerifier { @override Future startAt(int version) { - return schemaAt(version).then((schema) => schema.connection); + return schemaAt(version).then((schema) => schema.newConnection()); } }