diff --git a/docs/pages/docs/Advanced Features/expressions.md b/docs/pages/docs/Advanced Features/expressions.md index 4b82d94d..5d329e26 100644 --- a/docs/pages/docs/Advanced Features/expressions.md +++ b/docs/pages/docs/Advanced Features/expressions.md @@ -192,7 +192,7 @@ with the `separator` argument on `groupConcat`. ## Mathematical functions and regexp -When using a `VmDatabase`, a basic set of trigonometric functions will be available. +When using a `NativeDatabase`, a basic set of trigonometric functions will be available. It also defines the `REGEXP` function, which allows you to use `a REGEXP b` in sql queries. For more information, see the [list of functions]({{ "../Other engines/vm.md#moor-only-functions" | pageUrl }}) here. diff --git a/docs/pages/docs/Advanced Features/isolates.md b/docs/pages/docs/Advanced Features/isolates.md index 2663a352..516557f7 100644 --- a/docs/pages/docs/Advanced Features/isolates.md +++ b/docs/pages/docs/Advanced Features/isolates.md @@ -22,7 +22,7 @@ Next, re-run the build. You can now add another constructor to the generated dat ```dart @DriftDatabase(...) class TodoDb extends _$TodoDb { - TodoDb() : super(VmDatabase.memory()); + TodoDb() : super(NativeDatabase.memory()); // this is the new constructor TodoDb.connect(DatabaseConnection connection) : super.connect(connection); @@ -38,11 +38,11 @@ import 'package:drift/isolate.dart'; // This needs to be a top-level method because it's run on a background isolate DatabaseConnection _backgroundConnection() { // Construct the database to use. This example uses a non-persistent in-memory database each - // time. You can use your existing VmDatabase with a file as well, or a `LazyDatabase` if you + // time. You can use your existing NativeDatabase with a file as well, or a `LazyDatabase` if you // need to construct it asynchronously. // When using a Flutter plugin like `path_provider` to determine the path, also see the // "Initialization on the main thread" section below! - final database = VmDatabase.memory(); + final database = NativeDatabase.memory(); return DatabaseConnection.fromExecutor(database); } diff --git a/docs/pages/docs/Examples/existing_databases.md b/docs/pages/docs/Examples/existing_databases.md index ff4ee943..16985394 100644 --- a/docs/pages/docs/Examples/existing_databases.md +++ b/docs/pages/docs/Examples/existing_databases.md @@ -48,7 +48,7 @@ LazyDatabase _openConnection() { await file.writeAsBytes(blob); } - return VmDatabase(file); + return NativeDatabase(file); }); } ``` diff --git a/docs/pages/docs/Getting started/starting_with_sql.md b/docs/pages/docs/Getting started/starting_with_sql.md index f28ba03e..b8b77bcf 100644 --- a/docs/pages/docs/Getting started/starting_with_sql.md +++ b/docs/pages/docs/Getting started/starting_with_sql.md @@ -124,7 +124,7 @@ LazyDatabase _openConnection() { // for your app. final dbFolder = await getApplicationDocumentsDirectory(); final file = File(p.join(dbFolder.path, 'db.sqlite')); - return VmDatabase(file); + return NativeDatabase(file); }); } ``` diff --git a/docs/pages/docs/Other engines/encryption.md b/docs/pages/docs/Other engines/encryption.md index c3854435..cd189d00 100644 --- a/docs/pages/docs/Other engines/encryption.md +++ b/docs/pages/docs/Other engines/encryption.md @@ -32,7 +32,7 @@ dependencies: Instead of importing `package:moor_flutter/moor_flutter` (or `package:drift/native.dart`) in your apps, you would then import both `package:drift/drift.dart` and `package:encrypted_moor/encrypted_moor.dart`. -Finally, you can replace `FlutterQueryExecutor` (or an `VmDatabase`) with an `EncryptedExecutor`. +Finally, you can replace `FlutterQueryExecutor` (or a `NativeDatabase`) with an `EncryptedExecutor`. ### Extra setup on Android and iOS diff --git a/docs/pages/docs/Other engines/vm.md b/docs/pages/docs/Other engines/vm.md index 138cc0c0..94c2c15e 100644 --- a/docs/pages/docs/Other engines/vm.md +++ b/docs/pages/docs/Other engines/vm.md @@ -70,7 +70,7 @@ import 'package:path/path.dart' as p; LazyDatabase(() async { final dbFolder = await getDatabasesPath(); final file = File(p.join(dbFolder, 'db.sqlite')); - return VmDatabase(file); + return NativeDatabase(file); }) ``` @@ -82,7 +82,7 @@ Please be aware that `FlutterQueryExecutor.inDatabaseFolder` might yield a diffe ## Using native drift with an existing database {#using-moor-ffi-with-an-existing-database} -If your existing sqlite database is stored as a file, you can just use `VmDatabase(thatFile)` - no further +If your existing sqlite database is stored as a file, you can just use `NativeDatabase(thatFile)` - no further changes are required. If you want to load databases from assets or any other source, you can use a `LazyDatabase`. diff --git a/docs/pages/docs/faq.md b/docs/pages/docs/faq.md index 56fc5edc..ed78bbd1 100644 --- a/docs/pages/docs/faq.md +++ b/docs/pages/docs/faq.md @@ -65,7 +65,7 @@ You might have to restart your IDE for the changes to apply. ## How can I inspect generated SQL? -All database implementations (`VmDatabase`, `FlutterQueryExecutor`, ...) have a `logStatements` parameter that +All database implementations (`NativeDatabase`, `FlutterQueryExecutor`, ...) have a `logStatements` parameter that you can set to `true`. When enabled, drift will print the statements it runs. ## How do I insert data on the first app start? diff --git a/docs/pages/docs/platforms.md b/docs/pages/docs/platforms.md index e53bf619..515220c2 100644 --- a/docs/pages/docs/platforms.md +++ b/docs/pages/docs/platforms.md @@ -86,7 +86,7 @@ details. ### macOS -This one is easy! Just use the `VmDatabase` from `package:drift/native.dart`. No further setup is +This one is easy! Just use the `NativeDatabase` from `package:drift/native.dart`. No further setup is necessary. If you need a custom sqlite3 library, or want to make sure that your app will always use a diff --git a/docs/pages/docs/testing.md b/docs/pages/docs/testing.md index 03f60c2c..6597d50c 100644 --- a/docs/pages/docs/testing.md +++ b/docs/pages/docs/testing.md @@ -70,7 +70,7 @@ all apps will run with this `PATH` change. ## Writing tests We can create an in-memory version of the database by using a -`VmDatabase.memory()` instead of a `FlutterQueryExecutor`. A good +`NativeDatabase.memory()` instead of a `FlutterQueryExecutor` or other implementations. A good place to open the database is the `setUp` and `tearDown` methods from `package:test`: ```dart @@ -83,7 +83,7 @@ void main() { MyDatabase database; setUp(() { - database = MyDatabase(VmDatabase.memory()); + database = MyDatabase(NativeDatabase.memory()); }); tearDown(() async { await database.close();