Skip to main content

sqflite_ffi 0.1.1+2 copy "sqflite_ffi: ^0.1.1+2" to clipboard
sqflite_ffi: ^0.1.1+2 copied to clipboard

sqflite ffi based implementation for flutter, sharing the sqflite isolate between isolates using IsolateNameServer.

example/main.dart

import 'package:flutter/widgets.dart';
import 'package:sqflite_ffi/sqflite_ffi.dart';

/// Opens an in memory database and shows the SQLite version.
///
/// Add sqflite_ffi to a Flutter app (`flutter pub add sqflite_ffi`) and use
/// this as its `lib/main.dart`.
Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();
  // The global databaseFactory was set by sqflite_ffi at startup; the
  // factory can also be used directly: sqfliteDatabaseFactoryFfi.
  var db = await openDatabase(inMemoryDatabasePath);
  var rows = await db.rawQuery('SELECT sqlite_version() AS version');
  await db.close();
  runApp(
    Directionality(
      textDirection: TextDirection.ltr,
      child: Center(child: Text('SQLite ${rows.first['version']}')),
    ),
  );
}
0
likes
160
points
480
downloads

Documentation

API reference

Publisher

verified publishertekartik.com

Weekly Downloads

sqflite ffi based implementation for flutter, sharing the sqflite isolate between isolates using IsolateNameServer.

Repository (GitHub)
View/report issues

Topics

#sql #database

Funding

Consider supporting this project:

github.com

License

BSD-2-Clause (license)

Dependencies

flutter, sqflite_common_ffi

More

Packages that depend on sqflite_ffi

Packages that implement sqflite_ffi