WatermelonDB v0.17 Release NotesRelease Date: 2020-06-22 // 14 days ago
🆕 New features
- 🔀 [Sync] Introducing Migration Syncs - this allows fully consistent synchronization when migrating between schema versions. Previously, there was no mechanism to incrementally fetch all remote changes in new tables and columns after a migration - so local copy was likely inconsistent, requiring a re-login. After adopting migration syncs, Watermelon Sync will request from backend all missing information. See Sync docs for more details.
The new adapter is up to 3x faster than the previously fastest
synchronous: trueoption, however this speedup is only achieved with some unpublished React Native patches.
To try out JSI, add
Q.experimentalSkip(count)methods (only availble with SQLiteAdapter) - @Kenneth-KT
Database.batch()can now be called with a single array of models
Database.get(tableName)is now a shortcut for
[DX] Query is now thenable - you can now use
await query.countinstead of
[DX] Relation is now thenable - you can now use
await relationinstead of
model.dbas shortcuts to get to their Database object
- [Hardening] Column and table names starting with
__, Object property names (e.g.
constructor), and some reserved keywords are now forbidden
- 🏗 [DX] [Hardening] QueryDescription builder methods do tighter type checks, catching more bugs, and preventing users from unwisely passing unsanitized user data into Query builder methods
- [DX] [Hardening] Adapters check early if table names are valid
- [DX] Collection.find reports an error more quickly if an obviously invalid ID is passed
- [DX] Intializing Database with invalid model classes will now show a helpful error
- [DX] DatabaseProvider shows a more helpful error if used improperly
- 🏗 [Sync] Sync no longer fails if pullChanges returns collections that don't exist on the frontend - shows a warning instead. This is to make building backwards-compatible backends less error-prone
- 📚 [Sync] [Docs] Sync documentation has been rewritten, and is now closer in detail to a formal specification
- 👍 [Hardening] database.collections.get() better validates passed value
- [Hardening] Prevents unsafe strings from being passed as column name/table name arguments in QueryDescription
- 🔀 [Sync] Fixed
RangeError: Maximum call stack size exceededwhen syncing large amounts of data - @leninlin
- 🛠 [iOS] Fixed a bug that could cause a database operation to fail with an (6) SQLITE_LOCKED error
- 🏗 [iOS] Fixed 'jsi/jsi.h' file not found when building at the consumer level. Added path
$(SRCROOT)/../../../../../ios/Pods/Headers/Public/React-jsito Header Search Paths (issue #691) - @victorbutler
- [Native] SQLite keywords used as table or column names no longer crash
- 🛠 Fixed potential issues when subscribing to database, collection, model, queries passing a subscriber function with the same identity more than once
- 🛠 Fixed broken adapter tests
Previous changes from v0.16.1
Database.unsafeResetDatabase()is now less unsafe — more application bugs are being caught
- 🏗 [iOS] Fix build in apps using Flipper
- [Typescript] Added type definition for
- 🛠 [Typescript] Fixed types of decorators.
- ✅ [Typescript] Add Tests to test Types.
- 🛠 Fixed typo in learn-to-use docs.
- 🛠 [Typescript] Fixed types of changes.
- [SQLite] Infrastruture for a future JSI adapter has been added