sembast_sqflite 2.0.0+1
sembast_sqflite: ^2.0.0+1 copied to clipboard

sembast NoSQL database support on top of sqflite, cross process safe database.

example/main.dart

import 'package:sembast/sembast.dart';
import 'package:sembast_sqflite/sembast_sqflite.dart';
import 'package:sqflite_common_ffi/sqflite_ffi.dart';

Future main() async {
  // The sqflite base factory

  var factory = getDatabaseFactorySqflite(databaseFactoryFfi);

  var db = await factory.openDatabase('example.db');
  // Use the main store for storing key values as String
  var store = StoreRef<String, String>.main();

  // Writing the data
  await store.record('username').put(db, 'my_username');
  await store.record('url').put(db, 'my_url');

  // Reading the data
  var url = await store.record('url').get(db);
  var username = await store.record('username').get(db);

  print('url: $url');
  print('username: $username');
}
16
likes
120
pub points
81%
popularity

Publisher

tekartik.com

sembast NoSQL database support on top of sqflite, cross process safe database.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-2-Clause (LICENSE)

Dependencies

collection, meta, sembast, sqflite_common

More

Packages that depend on sembast_sqflite