angel_sembast 1.0.0

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • new60

sembast

Pub build status

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

Installation

Add the following to your pubspec.yaml:

dependencies:
  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:

/path/to/service?foo=bar

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": where.id(new 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.

example/main.dart

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');

  app
    ..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('127.0.0.1', 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:


dependencies:
  angel_sembast: ^1.0.0

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or flutter packages 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.0 Nov 6, 2018 Go to the documentation of angel_sembast 1.0.0 Download angel_sembast 1.0.0 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
21
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]
60
Learn more about scoring.

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

  • Dart: 2.0.0
  • pana: 0.12.6

Platforms

Detected platforms: Flutter, other

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

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev <3.0.0
angel_framework ^2.0.0-alpha 2.0.0-alpha.14
sembast ^1.9.5 1.10.1
Transitive dependencies
angel_container 1.0.0-alpha.12
angel_model 1.0.0+1
angel_route 3.0.0
body_parser 1.1.1
charcode 1.1.2
code_buffer 1.0.1
collection 1.14.11
combinator 1.0.0+3
convert 2.0.2
crypto 2.0.6
dart2_constant 1.0.2+dart2
file 5.0.6
http2 0.1.9
http_parser 3.1.3
http_server 0.9.8+1
intl 0.15.7
matcher 0.12.4
merge_map 1.0.1
meta 1.1.6
mime 0.9.6+2
mock_request 1.0.4
path 1.6.2
quiver 2.0.1
source_span 1.4.1
stack_trace 1.9.3
string_scanner 1.0.4
synchronized 1.5.3
tuple 1.0.2
typed_data 1.1.6
uuid 1.0.3
Dev dependencies
angel_http_exception ^1.0.0 1.0.0+3
logging any 0.11.3+2
test ^1.0.0