![]() ![]() ![]() The new package:drift/native.dart implementation uses dart:ffi to bind to sqlite3's native C apis. They don't work in Dart projects not using flutter.įor new projects, we generally recommend the newer ffi-based implementation, but drift_sqflite is maintaned and supported too. They use Flutter's package channels and support both Android and iOS. There are two drift implementations for mobile that you can use: using drift_sqfliteĭrift_sqflite (formerly known as moor_flutter) is a package using the sqflite package to provide a drift database implementation. This repository gives an example on how to do that with conditional imports. To support all platforms in a shared codebase, you only need to change how you open your database, all other usages can stay the same. WasmDatabase from package:drift/wasm.dart For support outside of Flutter, or in flutter test, see the desktop section below. No further setup is required for Flutter users. NativeDatabase from package:drift/native.dart Uses platform channels, Flutter only, no isolate support, doesn't support flutter test. SqfliteQueryExecutor from package:drift_sqflite This table list all supported drift implementations and on which platforms they run on. Depending on your platform, you can choose a different QueryExecutor. When writing drift apps, prefer to mainly use the apis in package:drift/drift.dart as they are guaranteed to work across all platforms. The core apis are pure-Dart and run on all Dart platforms, even outside of Flutter. To achieve platform independence, drift separates its core apis from a platform-specific database implementation. ![]() To clear confusion about different drift packages and when to use them, this document lists all supported platforms and how to use drift when building apps for them. Since the initial release, the Dart and Flutter ecosystems have changed a lot. All platforms supported by drift, and how to use themīeing built on top of the sqlite3 database, drift can run on almost every Dart platform. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |