This commit also adds a new :self-ref rule.
`[[page]]` will uses :self-ref,
`(or [[page1]] [[page2]])` will be `(or [:self-ref page1] [:self-ref
page2]`.
`(and [[page1]] [[page2]])` will be `(and [:page-ref page1] [:page-ref
page2] (or [:self-ref page1] [:self-ref page2]))` to ensure the query
result nodes to have at least one page reference.
Move testing requirement to relevant test to make production code easier
to maintain. Where possible we should avoid helpers like util/node-test? as
they couple testing concerns with production code
from original *property rules by giving simple queries
their own rules. This allows simple queries to grow in functionality
and complexity without affecting other features. Also fixed
private-property rule wasn't working because deps weren't configured
Throwing errors on unsupported filters for these makes it seem like we
support it when we don't. Better to be explicit. Also tweak
related tests so that file graph filters only run for file graphs
Maintains backwards compatibility for property filter queries
which fixes imported and handwritten property queries. Extended
sqlite.build and test-helper capabilities in order to test this.
Fixes LOG-3231
In #11508 db graphs moved to a new table which improved but
changed how sort worked for queries. Better to deprecate
the text sort-by filter than to have a buggy and inconsistent sort
for queries
After upgrading our forked datascript from 1.5.3 to 1.7.1,
bindings in two of our rules behaved differently. The workaround
of adding an `and` where none was required before is sufficient.
Fixes LOG-3177
Also fixed a dsl-query sorting bug where nil property values where
incorrectly being treated as greater than non-nil values. Also
fixed a bug where blocks with an explicit :block/created-at weren't
being set for sqlite-build
This PR also remove supports for:
1. merge pages when renaming a page to existing page
2. namespaces such as a/b/c
3. nested page such as [[a [[nested page]]]]
Pages merge might be added back depends on RTC, but it should be
decoupled from renaming, otherwise it's too complex.
Namespaces and nested pages have been contributed some critical bugs
that lead data-loss, they're so complex together with page alias,
it's just impossible to have a good test coverage and ensure the app
is stable, especially when page rename and RTC.