Skip to main content

quickeydb 3.0.0 copy "quickeydb: ^3.0.0" to clipboard
quickeydb: ^3.0.0 copied to clipboard

SQLite ORM for Flutter with typed DAOs, scoped queries, relations, transactions, encrypted values and browser storage.

example/example.md

QuickeyDB: SQL to a ready DAO #

Run dart run example/quickeydb_example.dart from a repository checkout after flutter pub get --no-example. This example needs no sibling packages or native SQLite initialization. Review the generated source, then register NotesDao() with QuickeyDB.initialize(dataAccessObjects: [NotesDao()], ...).

// Console output is the purpose of this source-generation example.
// ignore_for_file: avoid_print

import 'package:quickeydb/codegen/sql_dao_generator.dart';

/// Run with `dart run example/quickeydb_example.dart` from the package root.
/// This generates source only; it never creates or changes a database.
void main() {
  final generated = generateNotesDao();
  print(generated.source);
  print('Register with dataAccessObjects: ${generated.registration}');
}

SqlDaoGeneration generateNotesDao() => const SqlDaoGenerator().generate('''
CREATE TABLE notes (
  id INTEGER PRIMARY KEY AUTOINCREMENT,
  title TEXT NOT NULL,
  done INTEGER NOT NULL DEFAULT 0
);
''');

For complete CRUD, queries and encryption demos, see the Material gallery.

11
likes
140
points
201
downloads
screenshot

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

SQLite ORM for Flutter with typed DAOs, scoped queries, relations, transactions, encrypted values and browser storage.

Topics

#sqlite #database #orm #encryption

License

Apache-2.0 (license)

Dependencies

collection, cryptography, flutter, idb_shim, path, path_provider, sqflite, sqflite_common, sqflite_common_ffi, sqflite_common_ffi_web

More

Packages that depend on quickeydb