angel_sembast 1.0.0

  • Example
  • Installing
  • Versions
  • 53

sembast #

Pub build status

package:sembast-powered CRUD services for the Angel framework.

Installation #

Add the following to your pubspec.yaml:

  angel_sembast: ^1.0.0

Usage #

This library exposes one main class: SembastService.

SembastService #

This class interacts with a Database and Store (from package:sembast) and serializes data to and from Maps.

Querying #

You can query these services as follows:


The above will query the database to find records where 'foo' equals 'bar'.

The former will sort result in ascending order of creation, and so will the latter.

List queried = await MyService.index({r"query": Finder(filter: new Filter(...))));

Of course, you can use package:sembast queries. Just pass it as query within params.

See the tests for more usage examples.

1.0.0 #

  • First release.


import 'package:angel_framework/angel_framework.dart';
import 'package:angel_framework/http.dart';
import 'package:angel_sembast/angel_sembast.dart';
import 'package:logging/logging.dart';
import 'package:sembast/sembast_io.dart';

main() async {
  var app = new Angel();
  var db = await databaseFactoryIo.openDatabase('todos.db');

    ..logger = (new Logger('angel_sembast_example')..onRecord.listen(print))
    ..use('/api/todos', new SembastService(db, store: 'todos'))
    ..shutdownHooks.add((_) => db.close());

  var http = new AngelHttp(app);
  var server = await http.startServer('', 3000);
  var uri =
      new Uri(scheme: 'http', host: server.address.address, port: server.port);
  print('angel_sembast example listening at $uri');

Use this package as a library

1. Depend on it

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

  angel_sembast: ^1.0.0

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter pub get

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

3. Import it

Now in your Dart code, you can use:

import 'package:angel_sembast/angel_sembast.dart';
Version Uploaded Documentation Archive
1.0.1 Apr 20, 2019 Go to the documentation of angel_sembast 1.0.1 Download angel_sembast 1.0.1 archive
1.0.0 Nov 6, 2018 Go to the documentation of angel_sembast 1.0.0 Download angel_sembast 1.0.0 archive
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on May 8, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.3.0
  • pana: 0.12.15


Detected platforms: Flutter, other

Primary library: package:angel_sembast/angel_sembast.dart with components: io.

Health suggestions

Fix lib/angel_sembast.dart. (-1 points)

Analysis of lib/angel_sembast.dart reported 2 hints:

line 18 col 41: Use = to separate a named parameter from its default value.

line 18 col 65: Use = to separate a named parameter from its default value.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev <3.0.0
angel_framework ^2.0.0-alpha 2.0.1
sembast ^1.9.5 1.15.3+1
Transitive dependencies
angel_container 1.0.4
angel_model 1.0.3
angel_route 3.0.6
charcode 1.1.2
code_buffer 1.0.1
collection 1.14.11
combinator 1.1.0
convert 2.1.1
crypto 2.0.6
dart2_constant 1.0.2+dart2
file 5.0.7
http2 1.0.0
http_parser 3.1.3
http_server 0.9.8+1
intl 0.15.8
matcher 0.12.5
merge_map 1.0.2
meta 1.1.7
mime 0.9.6+2
mock_request 1.0.5
path 1.6.2
pedantic 1.6.0
quiver 2.0.3
quiver_hashcode 2.0.0
source_span 1.5.5
stack_trace 1.9.3
string_scanner 1.0.4
synchronized 2.1.0
term_glyph 1.1.0
tuple 1.0.2
typed_data 1.1.6
uuid 2.0.1
Dev dependencies
angel_http_exception ^1.0.0 1.1.0
logging any 0.11.3+2
test ^1.0.0