flutter-tizen / plugins

Flutter plugins for Tizen
65 stars 46 forks source link

[sqflite] The FFI implementation of sqflite_tizen #277

Open swift-kim opened 2 years ago

swift-kim commented 2 years ago

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.

dependencies:
  sqflite:
  sqflite_tizen:
    git: https://github.com/swift-kim/plugins
    ref: sqflite
    path: packages/sqflite

Current status

The following tests (from the sqflite example app) are currently failing. No critical error found. None of the errors are Tizen-specific.

https://github.com/flutter-tizen/plugins/pull/276#issuecomment-970168882

swift-kim commented 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.

swift-kim commented 2 years ago

Comparisons: