WatermelonDB v0.18 Release NotesRelease Date: 2020-06-30 // almost 2 years ago
🚀 Another WatermelonDB release after just a week? Yup! And it's jam-packed full of features!
🆕 New features
Q.onqueries are now far more flexible. Previously, they could only be placed at the top level of a query. See Docs for more details. Now, you can:
Pass multiple conditions on the related query, like so:
collection.query( Q.on('projects', [ Q.where('foo', 'bar'), Q.where('bar', 'baz'), ]) )
You can place
Q.ondeeper inside the query (nested inside
Q.or()). However, you must explicitly list all tables you're joining on at the beginning of a query, using:
You can nest
Q.on, e.g. to make a condition on a grandchild. To do so, it's required to pass
Q.experimentalNestedJoin('parent_table', 'grandparent_table')at the beginning of a query
Q.unsafeLokiExpr()are introduced to allow adding bits of queries that are not supported by the WatermelonDB query language without having to use
unsafeFetchRecordsWithSQL(). See docs for more details
Q.unsafeLokiFilter((rawRecord, loki) => boolean)can now be used as an escape hatch to make queries with LokiJSAdapter that are not otherwise possible (e.g. multi-table column comparisons). See docs for more details
- 🐎 [Performance] [LokiJS] Improved performance of queries containing query comparisons on LokiJSAdapter
- 📄 [Docs] Added Contributing guide for Query language improvements
- 🗄 [Deprecation]
- [DX] Queries with bad associations now show more helpful error message
- [Query] Counting queries that contain
Q.experimentalSkipis currently broken - previously it would return incorrect results, but now it will throw an error to avoid confusion. Please contribute to fix the root cause!
- 🛠 [Typescript] Fixed types of Relation
QueryDescriptionstructure has been changed.