Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[sqflite] The FFI implementation of sqflite_tizen #277

Open
swift-kim opened this issue Nov 23, 2021 · 2 comments
Open

[sqflite] The FFI implementation of sqflite_tizen #277

swift-kim opened this issue Nov 23, 2021 · 2 comments
Labels
proposal New plugin request or proposal

Comments

@swift-kim
Copy link
Member

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.

  • Raw tests
    • Options: Not implemented by sqflite_common_ffi.
    • Debug mode (log): Partially implemented by sqflite_common_ffi.
    • without rowid: Bad test case (0 is returned on Tizen).
  • Open tests
    • open in transaction: A bug in sqflite_common_ffi.
    • Open non sqlite file: Bad test case (succeeds only on Android).
  • Type tests
    • blob: Not implemented by sqflite_common_ffi (see getSqlArguments in sqflite_ffi_impl.dart).
    • bool: Not implemented by sqflite_common_ffi.
  • Exp tests
    • sql dump file
  • Exception tests
    • Sqlite Exception
    • Sqlite batch Exception
    • Bind no argument (no iOS)
    • crash ios (no iOS)
    • Bind no parameter
    • Thread dead lock

#276 (comment)

@swift-kim swift-kim changed the title The FFI implementation of sqflite_tizen [sqflite] The FFI implementation of sqflite_tizen Dec 6, 2021
@swift-kim
Copy link
Member Author

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
Copy link
Member Author

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposal New plugin request or proposal
Projects
None yet
Development

No branches or pull requests

1 participant