mirror of
https://github.com/logseq/logseq.git
synced 2026-02-01 22:47:36 +00:00
refactor: replace :block/left with :block/order
Finally no need to worry about parent-left conflicts and broken chain. With :block/order, we only need to re-compute new orders for siblings with same order (it can happens if there're bugs in our code, or updates from rtc), but it doesn't break UI. Another huge potential benefit after discussing with Zhiyuan is: Ee might be able to simplify both RTC and undo/redo, currently, we need to handle each new op for both of them, with recently refactorings like properties being db attributes, :block/order is a string instead of a ref, we can handle most property value conflicts using last-write-wins, and others (e.g. :block/parent, property with :default type) specifically. I haven't fixed the issues of using :block/left in RTC and undo/redo, because we might change both soon.
This commit is contained in:
@@ -365,7 +365,7 @@ These tasks are specific to database graphs. For these tasks there is a one time
|
||||
```sh
|
||||
$ bb dev:db-query woot '[:find (pull ?b [*]) :where (block-content ?b "Dogma")]'
|
||||
DB contains 833 datoms
|
||||
[{:block/tx-id 536870923, :block/link #:db{:id 100065}, :block/uuid #uuid "65565c26-f972-4400-bce4-a15df488784d", :block/updated-at 1700158508564, :block/left #:db{:id 100051}, :block/refs [#:db{:id 100064}], :block/created-at 1700158502056, :block/format :markdown, :block/tags [#:db{:id 100064}], :block/content "Dogma #~^65565c2a-b1c5-4dc8-a0f0-81b786bc5c6d", :db/id 100090, :block/path-refs [#:db{:id 100051} #:db{:id 100064}], :block/parent #:db{:id 100051}, :block/page #:db{:id 100051}}]
|
||||
[{:block/tx-id 536870923, :block/link #:db{:id 100065}, :block/uuid #uuid "65565c26-f972-4400-bce4-a15df488784d", :block/updated-at 1700158508564, :block/order "a0", :block/refs [#:db{:id 100064}], :block/created-at 1700158502056, :block/format :markdown, :block/tags [#:db{:id 100064}], :block/content "Dogma #~^65565c2a-b1c5-4dc8-a0f0-81b786bc5c6d", :db/id 100090, :block/path-refs [#:db{:id 100051} #:db{:id 100064}], :block/parent #:db{:id 100051}, :block/page #:db{:id 100051}}]
|
||||
```
|
||||
|
||||
* `dev:db-transact` - Run a `d/transact!` against the queried results of a DB graph
|
||||
@@ -420,7 +420,7 @@ These tasks are specific to database graphs. For these tasks there is a one time
|
||||
#uuid "6581c8db-a2a2-4e09-b30d-cdea6ad69512"
|
||||
536871037
|
||||
true]]]
|
||||
|
||||
|
||||
# By default this task ignores commonly changing datascript attributes.
|
||||
# To see all changed attributes, tell the task to ignore a nonexistent attribute:
|
||||
$ bb dev:diff-datoms w2.edn w3.edn -i a
|
||||
@@ -439,7 +439,7 @@ These tasks are specific to database graphs. For these tasks there is a one time
|
||||
[162 :block/content "b7" 536871039 true]
|
||||
[162 :block/created-at 1703004379103 536871037 true]
|
||||
[162 :block/format :markdown 536871037 true]
|
||||
[162 :block/left 149 536871037 true]
|
||||
[162 :block/order "a0" 536871037 true]
|
||||
[162 :block/page 149 536871037 true]
|
||||
[162 :block/parent 149 536871037 true]
|
||||
[162 :block/path-refs 108 536871044 true]
|
||||
|
||||
Reference in New Issue
Block a user