sembast_web 0.1.0+3

Sembast for the web #

Preview: sembast for the Web, NoSQL persistent embedded database for the Web on top of IndexedDB.

Setup #

In pubspec.yaml

dependencies:
  sembast_web: '>=0.1.0'

Usage #

import 'package:sembast/sembast.dart';
import 'package:sembast_web/sembast_web.dart';

Future main() async {
  // Declare our store (records are mapd, ids are ints)
  var store = intMapStoreFactory.store();
  var factory = databaseFactoryWeb;

  // Open the database
  var db = await factory.openDatabase('test');

  // Add a new record
  var key =
      await store.add(db, <String, dynamic>{'name': 'Table', 'price': 15});

  // Read the record
  var value = await store.record(key).get(db);

  // Print the value
  print(value);

  // Close the database
  await db.close();
}

Features and bugs #

  • Experimental
  • Use int or key string only
  • Transactions are not cross-tab safe

0.1.0+3 #

  • Initial version, experimental

example/example.dart

import 'package:sembast_web/sembast_web.dart';
import 'package:sembast/sembast.dart';

Future main() async {
  // Declare our store (records are mapd, ids are ints)
  var store = intMapStoreFactory.store();
  var factory = databaseFactoryWeb;

  // Open the database
  var db = await factory.openDatabase('test');

  // Add a new record
  var key =
      await store.add(db, <String, dynamic>{'name': 'Table', 'price': 15});

  // Read the record
  var value = await store.record(key).get(db);

  // Print the value
  print(value);

  // Close the database
  await db.close();
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  sembast_web: ^0.1.0+3

2. Install it

You can install packages from the command line:

with pub:


$ pub get

Alternatively, your editor might support pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:sembast_web/sembast_web.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
50
Learn more about scoring.

We analyzed this package on Feb 14, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.5

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.7.0 <3.0.0
idb_shim >=1.10.3-dev.1 <2.0.0 1.10.3-dev.1
sembast 2.2.0-dev.2 2.2.0-dev.2
Transitive dependencies
collection 1.14.12
js 0.6.1+1
meta 1.1.8
path 1.6.4
synchronized 2.2.0
Dev dependencies
build_runner >=1.5.0
build_test >=0.10.2
build_web_compilers >=0.4.0
pedantic >=1.8.0
process_run any
test >=1.6.0
webdev any