tecfy_database 1.2.1
tecfy_database: ^1.2.1 copied to clipboard
A fast, realtime, JSON-based, index-driven local database for Flutter, built on SQLite. Schemaless documents with native indexed queries and reactive streams.
1.2.0 #
Added #
- Optional
TecfyDatabase(databaseFactory:, inMemory:)parameters — open with a custom sqflite factory and/or an in-memory database. Fully backward compatible; existing constructors are unaffected. - New exports:
DatabaseFactory,databaseFactoryFfi,sqfliteFfiInit, andinMemoryDatabasePath(useful for writing your own tests). - Full unit test suite (init/isReady, CRUD, document ops, primary keys, schema migration, field types, filters, search/pagination, batch, streams, error paths) with ~90% line coverage.
- GitHub Actions CI: format check, analyze, tests with coverage, and
pub publishdry-run. - Runnable benchmark harness (
benchmark/tecfy_benchmark.dart) with indicative results published in the README. - Dartdoc comments across the public API.
- Expanded example app into a gallery: complex queries, batch, pagination, realtime streams, and error handling.
- Documentation: FAQ, Troubleshooting, Migration guide, per-platform limitations, and a Production Readiness guide (
doc/production_readiness.md). - Community files:
CONTRIBUTING.md, issue templates, and a pull-request template. .pubignoreto keep internal planning docs and build artifacts out of the published package.
Changed #
dispose()now returnsFuture<void>so callers canawaita clean close. Existingdispose();call sites remain valid.- Expanded the
pubspec.yamldescriptionand addedrepository/issue_trackermetadata.
Fixed #
- Custom primary keys: a collection declared with a custom
primaryField(non-id) now resolves correctly fordoc()lookups, updates, deletes, and read-back. Previously such collections queried/returned the literalidcolumn and inserted the key column asNULL. - No-filter aggregates:
searchCount(),searchAny(), and the no-filtercount()stream now count all rows. Previously they builtWHERE nulland always returned0/false. - Corrected the README datetime-filter example to pass an epoch integer.
Known issues #
- Indexed
datetimecolumns store microseconds internally while the document body uses milliseconds; theadd/getround trip is correct, butdatetimefilter values must be passed as epoch integers (yourDate.millisecondsSinceEpoch). See the README Troubleshooting section.
1.1.3 #
isReady()now waits until every collection's table and indexes are actually created (fixes "no such table" races on fresh installs).- Creating a second
TecfyDatabaseinstance (e.g. after logout/login) no longer hangsisReady()forever; it reuses the open database and rebuilds the collection operations. dispose()unregisters the GetIt database singleton and clears operations so a later re-init works.commitBatch()notifies listeners only after the commit completes, so listeners can't re-query before the new rows are visible.- Export
ConflictAlgorithmandBatchso callers can request upsert behavior without importing sqflite directly.
0.0.8 #
- enhance performance
0.0.1 #
- Describe initial release.