box 0.1.1

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

Use this package as a library

1. Depend on it

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


dependencies:
  box: ^0.1.1

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

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

  • Dart: 2.5.1
  • pana: 0.12.21

Platforms

Detected platforms: other

Primary library: package:box/box.dart with components: io, mirrors.

Health issues and suggestions

Document public APIs. (-0.43 points)

51 out of 52 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.

Fix lib/src/file.dart. (-6.31 points)

Analysis of lib/src/file.dart reported 13 hints, including:

line 16 col 3: The class 'Future' wasn't exported from 'dart:core' until version 2.1, but this code is required to be able to run on earlier versions.

line 18 col 12: The class 'Future' wasn't exported from 'dart:core' until version 2.1, but this code is required to be able to run on earlier versions.

line 21 col 3: The class 'Future' wasn't exported from 'dart:core' until version 2.1, but this code is required to be able to run on earlier versions.

line 29 col 27: The class 'Stream' wasn't exported from 'dart:core' until version 2.1, but this code is required to be able to run on earlier versions.

line 42 col 3: The class 'Future' wasn't exported from 'dart:core' until version 2.1, but this code is required to be able to run on earlier versions.

Fix lib/src/memory.dart. (-4.41 points)

Analysis of lib/src/memory.dart reported 9 hints, including:

line 8 col 3: The class 'Future' wasn't exported from 'dart:core' until version 2.1, but this code is required to be able to run on earlier versions.

line 16 col 3: The class 'Future' wasn't exported from 'dart:core' until version 2.1, but this code is required to be able to run on earlier versions.

line 24 col 3: The class 'Stream' wasn't exported from 'dart:core' until version 2.1, but this code is required to be able to run on earlier versions.

line 26 col 12: The class 'Stream' wasn't exported from 'dart:core' until version 2.1, but this code is required to be able to run on earlier versions.

line 30 col 9: DO use curly braces for all flow control structures.

Fix lib/src/core.dart. (-2.48 points)

Analysis of lib/src/core.dart reported 5 hints:

line 5 col 3: The class 'Future' wasn't exported from 'dart:core' until version 2.1, but this code is required to be able to run on earlier versions.

line 15 col 3: The class 'Future' wasn't exported from 'dart:core' until version 2.1, but this code is required to be able to run on earlier versions.

line 41 col 3: The class 'Stream' wasn't exported from 'dart:core' until version 2.1, but this code is required to be able to run on earlier versions.

line 43 col 3: The class 'Future' wasn't exported from 'dart:core' until version 2.1, but this code is required to be able to run on earlier versions.

line 47 col 3: The class 'Future' wasn't exported from 'dart:core' until version 2.1, but this code is required to be able to run on earlier versions.

Fix additional 3 files with analysis or formatting issues.

Additional issues in the following files:

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

Maintenance issues and suggestions

Provide a file named CHANGELOG.md. (-20 points)

Changelog entries help developers follow the progress of your package. See the example generated by stagehand.

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.0.0 <3.0.0
collection ^1.14.11 1.14.12
io ^0.3.3 0.3.3
reflective ^0.1.1 0.1.8
Transitive dependencies
charcode 1.1.2
meta 1.1.7
path 1.6.4
source_span 1.5.5
string_scanner 1.0.5
term_glyph 1.1.0
Dev dependencies
test any