Open swift-kim opened 2 years ago
We can even use sqlite3
directly without needing to extend sqflite
.
import 'dart:ffi';
import 'package:sqlite3/open.dart';
import 'package:sqlite3/sqlite3.dart';
open.overrideFor(OperatingSystem.linux, () {
return DynamicLibrary.open('libsqlite3.so.0');
});
Database db = sqlite3.openInMemory();
db.execute('...');
Basic operations (such as CREATE
and INSERT
) just worked but more testing is needed.
Comparisons:
sqflite_tizen
(current): An implementation of sqflite
based on Tizen's sqlite3 API.sqflite_tizen
(FFI-based): An implementation of sqflite
based on sqflite_common_ffi
.sqflite_common_ffi
: An async wrapper around sqlite3
based on isolates.sqlite3
: The core binding library that has no built-in async support.drift
: An alternative relational database for Dart built on top of sqlite3
(written by the author of sqlite3
).
Source code
https://github.com/swift-kim/plugins/tree/sqflite/packages/sqflite
Usage
Add
sqflite_tizen
as a git package dependency in your pubspec.yaml.Current status
The following tests (from the sqflite example app) are currently failing. No critical error found. None of the errors are Tizen-specific.
getSqlArguments
insqflite_ffi_impl.dart
).https://github.com/flutter-tizen/plugins/pull/276#issuecomment-970168882