box 0.2.5

  • Readme
  • Changelog
  • Installing
  • 57

Dart Box #

A fluent Dart persistence API inspired by SQL. This library is still in an early phase of development. Currently Box has two implementations.

  • Box: a very simple implementation that runs completely in-memory.
  • FileBox: an in-memory implementation that persists data to a simple JSON file.

Support for various SQL and NoSQL databases is on the roadmap.

Example:

Box box = new FileBox('.box/test');
List<User> users = await box.selectFrom<User>()
                            .where('name').like('C%')
                            .orderBy('name').ascending()
                            .list();
users.forEach((user) => print(user.name)));

0.2.5 ONE OF & CONTAINS #

  • [x] ONE OF (IN) predicate
  • [x] CONTAINS predicate for arrays

0.2.4 Firestore #

  • [x] Removed dependency on mirrors at runtime
  • [x] Firestore support

0.2.3 Limit & Offset #

  • [x] Limit
  • [x] Offset
  • [x] Select and map result

0.2.2 MongoDB #

  • [x] MongoDB support
  • [x] Deep queries
  • [x] Greater than (or equal)
  • [x] Less than (or equal)
  • [x] Between
  • [x] Dynamically typed queries

Backlog #

  • [ ] PostgreSQL support
  • [ ] Automatic toJson and fromJson
  • [ ] SQLite support
  • [ ] Group by
  • [ ] Join
  • [ ] Emulate unsupported Firestore features

Use this package as a library

1. Depend on it

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


dependencies:
  box: ^0.2.5

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:box/box.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
25
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
75
Overall:
Weighted score of the above. [more]
57
Learn more about scoring.

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

  • Dart: 2.8.4
  • pana: 0.13.15

Analysis suggestions

Package not compatible with runtime flutter-web on Web

Because:

  • package:box/box.dart that imports:
  • package:box/file.dart that imports:
  • package:box/src/file.dart that imports:
  • dart:io

Package not compatible with runtime js

Because:

  • package:box/box.dart that imports:
  • package:box/file.dart that imports:
  • package:box/src/file.dart that imports:
  • dart:io

Health issues and suggestions

Document public APIs. (-0.80 points)

148 out of 149 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Format lib/core.dart.

Run dartfmt to format lib/core.dart.

Format lib/file.dart.

Run dartfmt to format lib/file.dart.

Format lib/memory.dart.

Run dartfmt to format lib/memory.dart.

Fix additional 5 files with analysis or formatting issues.

Additional issues in the following files:

  • lib/src/core.dart (Run dartfmt to format lib/src/core.dart.)
  • lib/src/file.dart (Run dartfmt to format lib/src/file.dart.)
  • lib/src/firestore.dart (Run dartfmt to format lib/src/firestore.dart.)
  • lib/src/memory.dart (Run dartfmt to format lib/src/memory.dart.)
  • lib/src/mongodb.dart (Run dartfmt to format lib/src/mongodb.dart.)

Maintenance suggestions

The package description is too short. (-15 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and box.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.3.0 <3.0.0
collection ^1.14.11 1.14.13 1.15.0-nullsafety
googleapis_auth ^0.2.11 0.2.12
http ^0.12.1 0.12.1
inflection2 ^0.4.2 0.4.3
io ^0.3.3 0.3.4
meta ^1.1.8 1.2.2 1.3.0-nullsafety
mongo_dart ^0.4.0 0.4.0
Transitive dependencies
async 2.4.2
bson 0.3.2
charcode 1.1.3
convert 2.1.1
crypto 2.1.5
fixnum 0.10.11
http_parser 3.1.4
logging 0.11.4
mongo_dart_query 0.4.1
more 1.18.2 2.5.0
path 1.7.0
pedantic 1.9.2
pool 1.4.0
source_span 1.7.0
stack_trace 1.9.5
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.2.0 1.3.0-nullsafety
uuid 2.2.0
Dev dependencies
box_generator
build_runner ^1.10.0
test ^1.6.0