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

Ultra-fast, lightweight NoSQL local database for Flutter and Dart apps, powered by a compact Rust native core.

example/README.md

Cindel example #

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

dependencies:
  cindel: ^0.3.4
  cindel_flutter_libs: ^0.3.4

dev_dependencies:
  build_runner: ^2.15.0
  cindel_generator: ^0.2.4

Define a model and generate its schema:

import 'package:cindel/cindel.dart';

part 'user.g.dart';

@Collection(name: 'users')
class User {
  Id id = 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 = 'ana@example.com'
    ..name = 'Ana';

  await db.users.put(user);

  final matches = await db.users
      .where()
      .emailEqualTo('ana@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
2
likes
0
points
195
downloads

Documentation

Documentation

Publisher

unverified uploader

Weekly Downloads

Ultra-fast, lightweight NoSQL local database for Flutter and Dart apps, powered by a compact Rust native core.

Repository (GitHub)
View/report issues

Topics

#database #nosql #flutter #ffi #local-storage

License

unknown (license)

Dependencies

cindel_annotations, ffi, hooks, native_toolchain_rust

More

Packages that depend on cindel