cindel 1.0.0 copy "cindel: ^1.0.0" to clipboard
cindel: ^1.0.0 copied to clipboard

Extremely fast, easy to use, fully async typed local database for Flutter and Dart, with MDBX and SQLite Web/OPFS backends.

example/README.md

Cindel example #

Add Cindel, the Flutter native libraries package, and the generator to your app:

dependencies:
  cindel: ^0.7.0
  cindel_flutter_libs: ^0.7.0

dev_dependencies:
  build_runner: ^2.15.0
  cindel_generator: ^0.6.4

Define a model and generate its schema:

import 'package:cindel/cindel.dart';

part 'user.g.dart';

@Collection(name: 'users')
class User {
  Id dbId = autoIncrement;

  @Index()
  late String email;

  late String name;
}

Use the generated schema and typed collection API:

import 'package:cindel/cindel.dart';

import 'user.dart';

Future<void> main() async {
  final db = await Cindel.open(
    directory: 'app_data',
    schemas: [UserSchema],
  );

  final user = User()
    ..email = 'jhon@example.com'
    ..name = 'Jhon Doe';

  await db.users.put(user);

  final matches = await db.users
      .where()
      .emailEqualTo('jhon@example.com')
      .findAll();

  print('Found ${matches.length} user(s).');

  await db.close();
}

Generate the code before running the app:

dart run build_runner build --delete-conflicting-outputs
4
likes
160
points
577
downloads

Documentation

Documentation
API reference

Publisher

unverified uploader

Weekly Downloads

Extremely fast, easy to use, fully async typed local database for Flutter and Dart, with MDBX and SQLite Web/OPFS backends.

Repository (GitHub)
View/report issues
Contributing

Topics

#database #nosql #storage #cindel #flutter

Funding

Consider supporting this project:

github.com

License

Apache-2.0 (license)

Dependencies

cindel_annotations, ffi, hooks, native_toolchain_rust, web

More

Packages that depend on cindel