sqflite_common_ffi_async 0.1.3+1 copy "sqflite_common_ffi_async: ^0.1.3+1" to clipboard
sqflite_common_ffi_async: ^0.1.3+1 copied to clipboard

Sqflite API on top on sqlite_async from PowerSync, ffi based implementation.

example/main.dart

// ignore_for_file: avoid_print

import 'package:sqflite_common_ffi/sqflite_ffi.dart';
import 'package:sqflite_common_ffi_async/sqflite_ffi_async.dart';

Future main() async {
  // Init ffi loader if needed.
  sqfliteFfiInit();

  var databaseFactory = databaseFactoryFfiAsync;
  var db = await databaseFactory.openDatabase('example.db');
  await db.execute('''
  CREATE TABLE Product (
      id INTEGER PRIMARY KEY,
      title TEXT
  )
  ''');
  await db.insert('Product', <String, Object?>{'title': 'Product 1'});
  await db.insert('Product', <String, Object?>{'title': 'Product 1'});

  var result = await db.query('Product');
  print(result);
  // prints [{id: 1, title: Product 1}, {id: 2, title: Product 1}]
  await db.close();
}
2
likes
160
pub points
12%
popularity

Publisher

verified publishertekartik.com

Sqflite API on top on sqlite_async from PowerSync, ffi based implementation.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-2-Clause (license)

Dependencies

path, sqflite_common, sqflite_common_ffi, sqlite_async

More

Packages that depend on sqflite_common_ffi_async