sqflite_common_ffi 2.3.4+4 copy "sqflite_common_ffi: ^2.3.4+4" to clipboard
sqflite_common_ffi: ^2.3.4+4 copied to clipboard

sqflite ffi based implementation, for desktop and units tests.

example/main.dart

// ignore_for_file: avoid_print

import 'package:sqflite_common_ffi/sqflite_ffi.dart';

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

  var databaseFactory = databaseFactoryFfi;
  var db = await databaseFactory.openDatabase(inMemoryDatabasePath);
  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();
}
282
likes
160
points
57.5k
downloads

Publisher

verified publishertekartik.com

Weekly Downloads

sqflite ffi based implementation, for desktop and units tests.

Repository (GitHub)
View/report issues

Topics

#sql #database

Documentation

API reference

Funding

Consider supporting this project:

github.com

License

BSD-2-Clause (license)

Dependencies

meta, path, sqflite_common, sqlite3, synchronized

More

Packages that depend on sqflite_common_ffi