wip: remove :block/name uniqueness for db based graphs

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.
This commit is contained in:
Tienson Qin
2024-04-02 23:10:04 +08:00
parent c448e9a0d0
commit 60d4fca0ba
73 changed files with 766 additions and 1343 deletions

View File

@@ -412,21 +412,6 @@ tags: [[other]]
(dsl-query "(page nope)")))
"Correctly returns no results"))
(deftest namespace-queries
(load-test-files [{:file/path "pages/ns1.page1.md"
:file/content "foo"}
{:file/path "pages/ns1.page2.md"
:file/content "bar"}
{:file/path "pages/ns2.page1.md"
:file/content "baz"}])
(is (= #{"ns1/page1" "ns1/page2"}
(set (map :block/name (dsl-query "(namespace ns1)")))))
(is (= #{}
(set (map :block/name (dsl-query "(namespace blarg)"))))
"Correctly returns no results"))
(deftest empty-queries
(testing "nil or blank strings should be ignored"
(are [x] (nil? (dsl-query x))