box 0.3.0+2 copy "box: ^0.3.0+2" to clipboard
box: ^0.3.0+2 copied to clipboard

outdated

A fluent Dart persistence API inspired by SQL that supports PostgreSQL, MongoDB, simple file and in-memory storage.

Dart Box #

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

  • MemoryBox: a very simple implementation that runs completely in-memory, ideal for unit tests and caching.
  • FileBox: an in-memory implementation that persists data to a simple JSON file, useful for simple applications with a low concurrency.
  • MongoDbBox
  • FirestoreBox: this implementation has some limitations, it does not support composite keys, LIKE, NOT, OR and IN.
  • PostgresBox: restricted to JSON types for lists and nested entities, it does not support arrays and complex types.

Box requires a registry to be generated from the entity model. See box_generator how to do so.

Example:

var registry = Registry()..register(User$BoxSupport());
var box = FileBox('.box/test', registry);

var users = await box.selectFrom<User>()
                            .where('name').like('C%')
                            .orderBy('name').ascending()
                            .list();
                            
users.forEach((user) => print(user.name));
11
likes
0
pub points
63%
popularity

Publisher

unverified uploader

A fluent Dart persistence API inspired by SQL that supports PostgreSQL, MongoDB, simple file and in-memory storage.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

collection, googleapis_auth, http, inflection2, io, meta, mongo_dart, postgres, recase

More

Packages that depend on box