Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/db #66

Open
wants to merge 6,272 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
6272 commits
Select commit Hold shift + click to select a range
6170ba1
chore: disable test since its unused per rcmerci
logseq-cldwalker Jan 23, 2025
926d05c
feat: table columns pinning (#11693)
tiensonqin Jan 24, 2025
423a4b0
feat: views support multiple columns sort (#11694)
tiensonqin Jan 24, 2025
c8c0e24
fix: don't add Task tag when status is used by another class
logseq-cldwalker Jan 24, 2025
a9d8591
fix: task simple query doesn't recognize default value
logseq-cldwalker Jan 24, 2025
3bad903
enhance(ux): add global app not found page
xyhp915 Jan 25, 2025
0dc45cb
fix: regression on query builder
tiensonqin Jan 26, 2025
3f9aa71
enhance: /scheduled and /deadline to create task
tiensonqin Jan 26, 2025
2cfc3f0
fix: sqlite.build should use :block/updated-at if passed in a block o…
logseq-cldwalker Jan 27, 2025
9b223be
enhance(dev): add util for logseq class idents
logseq-cldwalker Jan 27, 2025
57b4376
enhance(dev): test helper returns entity
logseq-cldwalker Jan 27, 2025
63184bc
fix: lint and test broken by previous commit
logseq-cldwalker Jan 27, 2025
ef93609
enhance(dev): build EDN supports logseq idents for :build/tags
logseq-cldwalker Jan 27, 2025
dbd1fae
fix: lint
logseq-cldwalker Jan 27, 2025
05496a0
fix: deprecate old srs config options
logseq-cldwalker Jan 28, 2025
5983bd0
enhance: update sqlite.build EDN to generate tx
logseq-cldwalker Jan 28, 2025
8550b48
enhance(dev): add test helper for ent properties
logseq-cldwalker Jan 28, 2025
fd99c0a
chore: use test helper instead of copied
logseq-cldwalker Jan 28, 2025
085872e
enhance: dev commands for exporting and importing
logseq-cldwalker Jan 29, 2025
77a6470
enhance: Allow commands to marked as :db-graph?
logseq-cldwalker Jan 29, 2025
574becd
enhance: import a block with properties across graphs
logseq-cldwalker Jan 29, 2025
b8ad82e
chore: add kondo aliases for db.sqlite namespaces
logseq-cldwalker Jan 29, 2025
3853fc5
fix: invalid data
tiensonqin Jan 30, 2025
bd4af68
enhance: can export+import classes across graphs
logseq-cldwalker Jan 30, 2025
ddf4dc0
enhance: export+import closed values across graphs
logseq-cldwalker Jan 30, 2025
002edb1
fix: sqlite.build auto-create new pages
logseq-cldwalker Jan 30, 2025
02f893f
enhance: better error handling when importing data
logseq-cldwalker Jan 31, 2025
a88c04f
fix: build-existing-tx? didn't differentiate
logseq-cldwalker Jan 31, 2025
44cf521
enhance: initial support for export+import of current page
logseq-cldwalker Feb 1, 2025
43c6633
enhance: page import works for existing pages
logseq-cldwalker Feb 3, 2025
469f77e
enhance: page export exports blocks at any level
logseq-cldwalker Feb 3, 2025
fbf7107
enhance: only build property export
logseq-cldwalker Feb 3, 2025
f66f310
fix: imported page not showing up
logseq-cldwalker Feb 3, 2025
d91b509
fix: import textarea not scrolling
logseq-cldwalker Feb 3, 2025
d06d582
enhance: can import :date properties
logseq-cldwalker Feb 3, 2025
c4fee6b
chore: remove deprecated [:page "FOO"]
logseq-cldwalker Feb 4, 2025
379752d
fix: tests broken by previous commit
logseq-cldwalker Feb 4, 2025
c925daa
enhance: export/import :node properties with classes
logseq-cldwalker Feb 4, 2025
a746a4d
enhance: import/export :node properties with block
logseq-cldwalker Feb 4, 2025
f02687b
fix: task query for "In Review" status
logseq-cldwalker Feb 5, 2025
ca011c9
enhance: add command to export/import graph's ontology
logseq-cldwalker Feb 5, 2025
38aff83
fix: export+import of blocks with built-in property closed values
logseq-cldwalker Feb 5, 2025
6848f98
fix: query builder not working for multi-word task values
logseq-cldwalker Feb 5, 2025
5faffdc
enhance: page export includes its properties and tags
logseq-cldwalker Feb 5, 2025
09ddf31
enhance(ux): force hide table header action popup for the pointer out…
xyhp915 Feb 6, 2025
b54d13b
enhance: sqlite.build EDN supports uuid refs
logseq-cldwalker Feb 6, 2025
02beff3
enhance: export+import page handles most ref types in blocks
logseq-cldwalker Feb 6, 2025
fcdfe51
enhance: export+export refs to classes
logseq-cldwalker Feb 7, 2025
3101640
chore: cleanup export tests
logseq-cldwalker Feb 7, 2025
8bc9b73
enhance: page export+import journal refs
logseq-cldwalker Feb 7, 2025
11669f8
fix: block ref export+import not working in app
logseq-cldwalker Feb 7, 2025
2edbadf
enhance: block export supports content refs
logseq-cldwalker Feb 7, 2025
ac8b3db
enhance: introduce :build/keep-uuid? for export/import
logseq-cldwalker Feb 7, 2025
3dcb1e5
fix: db migrate
tiensonqin Feb 8, 2025
2d802e3
enhance(rtc): add ns frontend.worker.rtc.migrate
RCmerci Jan 15, 2025
215f86a
enhance(rtc): rename ns frontend.worker.rtc.branch-graph, fix rtc mal…
RCmerci Jan 18, 2025
ebbb322
enhance(rtc): validate major-schema-version before rtc
RCmerci Jan 19, 2025
5ab04c5
refactor(db-sync): update rtc-log types
RCmerci Jan 19, 2025
42afa2f
enhance(rtc): add schema-version when calling register-graph-updates
RCmerci Jan 19, 2025
bec7835
enhance(rtc): add schema-version arg to related apis
RCmerci Jan 21, 2025
b177495
enhance(rtc): add background-task to notify client to upgrade
RCmerci Jan 21, 2025
452c678
enhance(rtc): transact :logseq.kv/remote-schema-version when upload/d…
RCmerci Jan 22, 2025
c721f4c
enhance(rtc): simplify rtc-apis in db-worker
RCmerci Jan 22, 2025
9a54d2a
enhance(rtc): notify when need to upload/download higher schema graphs
RCmerci Jan 22, 2025
5f57708
enhance(rtc): option to reset rtc-data in conn when upload-graph
RCmerci Jan 23, 2025
7961696
enhance(rtc): update fn reset-client-op-conn
RCmerci Jan 23, 2025
0e9f090
enhance(rtc): add db-worker rtc api rtc-async-branch-graph
RCmerci Jan 24, 2025
0f55ab4
enhance(rtc): create new graph branch when major-schema-version changed
RCmerci Jan 25, 2025
1c7ab05
fix(rtc): fix rtc-log type
RCmerci Jan 25, 2025
9c8696c
enhance(rtc): print ex-data when major-schema-version mismatch
RCmerci Jan 25, 2025
54cb6a2
enhance(rtc): update malli-schema for api response
RCmerci Jan 25, 2025
4b4c3c8
enhance(rtc): update rtc malli-schema
RCmerci Jan 28, 2025
5143d74
feat: introduce SchemaVersion to replace current schema-version using…
RCmerci Feb 5, 2025
3dddc43
enhance(rtc): show more info in debug-ui
RCmerci Feb 6, 2025
08a45dc
fix: use transit instead of ->clj&->js
RCmerci Feb 6, 2025
9309b4f
fix: fix combine-local-&-remote-graphs
RCmerci Feb 6, 2025
dfdd55a
chore: add docstring
RCmerci Feb 7, 2025
597e83e
chore: fix lint
RCmerci Feb 7, 2025
1ad5422
enhance(rtc): more precise malli-schema for :schema-version
RCmerci Feb 7, 2025
49658d8
fix: refresh local repos as well
RCmerci Feb 7, 2025
5a64e63
fix: sort
tiensonqin Feb 10, 2025
38a197e
feat: match all/any filters suport (#11695)
tiensonqin Feb 10, 2025
8140ba7
fix: sort
tiensonqin Feb 10, 2025
f5c227e
feat: match all/any filters suport (#11695)
tiensonqin Feb 10, 2025
381f9f1
Merge branch 'feat/db' into enhance/rtc-migrate-graph-schema
tiensonqin Feb 10, 2025
d9121cd
fix: property type migration from #11695
logseq-cldwalker Feb 10, 2025
8b8055d
refactor: use namespaced keyword for block export
logseq-cldwalker Feb 10, 2025
8faa1a9
fix: remove export+imports invalid
logseq-cldwalker Feb 10, 2025
8d3dbaa
fix(ux): incorrect behavior for the sub menu content within the table…
xyhp915 Feb 11, 2025
aae1bb0
fix: export commands return partial results
logseq-cldwalker Feb 11, 2025
4517f66
fix: frontend lint
logseq-cldwalker Feb 11, 2025
83078a9
enhance: include class children in all exports
logseq-cldwalker Feb 11, 2025
4ed5897
chore: enable export+import edn commands
logseq-cldwalker Feb 11, 2025
b6159b7
fix: typo
logseq-cldwalker Feb 11, 2025
4195d40
refactor: remove defrecord SchemaVersion, use a simple map for better…
RCmerci Feb 12, 2025
0533377
Merge remote-tracking branch 'origin/feat/db' into enhance/rtc-migrat…
RCmerci Feb 12, 2025
cda5b09
fix: delete block's property history when retracting a block
tiensonqin Feb 12, 2025
da6d853
Merge pull request #11722 from logseq/enhance/rtc-migrate-graph-schema
tiensonqin Feb 12, 2025
70aa057
fix: schema-version maybe a int
RCmerci Feb 12, 2025
7703887
fix: db-worker API does not currently support parameters of the UUID …
RCmerci Feb 12, 2025
e7e4294
Feat: view group by (#11731)
tiensonqin Feb 12, 2025
5c8b23f
fix: don't run rtc task in publishing
logseq-cldwalker Feb 12, 2025
fdf8176
fix: db-worker doesn't accept UUID parameter
tiensonqin Feb 12, 2025
d4b14d8
fix(ui): incorrect behavior for the table header action popups
xyhp915 Feb 13, 2025
c183686
wip: linked references view
tiensonqin Feb 13, 2025
dd97879
fix(rtc): fix format of :server-schema-version in the API get-graph-s…
RCmerci Feb 13, 2025
7da4f7a
enhance: improve error handling for exports + imports
logseq-cldwalker Feb 13, 2025
1038d79
fix: frontend lint
logseq-cldwalker Feb 13, 2025
8b02790
chore: add test helpers to reduce
logseq-cldwalker Feb 13, 2025
4f25e27
fix: exporting class parent or property class
logseq-cldwalker Feb 13, 2025
a4aacf0
chore: use medley/dissoc-in instead of copied version
logseq-cldwalker Feb 13, 2025
bbcc497
fix: schema version check
tiensonqin Feb 14, 2025
ce3f618
fix: parse-schema-version support sequential arg
RCmerci Feb 14, 2025
14d6230
fix(ui): block content blink for the spent time label
xyhp915 Feb 14, 2025
b9e4fad
fix: import of different types of refs still failed
logseq-cldwalker Feb 14, 2025
6071681
enhance: export+import block refs from a block
logseq-cldwalker Feb 14, 2025
52acbd0
fix: block objects failed import if they have properties
logseq-cldwalker Feb 14, 2025
c5b23f8
enhance: create linked reference view when there're references
tiensonqin Feb 17, 2025
31e022f
enhance(ux): persist custom shortcuts for web platform
xyhp915 Feb 17, 2025
fbb9c24
refactor: all views support tabs
tiensonqin Feb 17, 2025
6a5555b
fix: all pages view
tiensonqin Feb 17, 2025
4e70901
enhance: display columns visibility only for the table view
tiensonqin Feb 17, 2025
1139459
fix: keep old reference view for file graphs
tiensonqin Feb 17, 2025
73bcc08
style tweaks
tiensonqin Feb 17, 2025
a7c2035
fix: lint warnings
tiensonqin Feb 17, 2025
fac4a45
fix: allow any class to be a build/class-parent e.g. schema class
logseq-cldwalker Feb 16, 2025
8710195
chore: mv handler ns to file-based
logseq-cldwalker Feb 17, 2025
885c06f
chore: mv file-handler dependent namespaces
logseq-cldwalker Feb 17, 2025
f597f7c
chore: mv handler.common.file to file-based
logseq-cldwalker Feb 17, 2025
033c7e5
fix: export+import references to block
logseq-cldwalker Feb 17, 2025
af56de6
enhance(import): remove rtc related entities when import sqlite
RCmerci Feb 19, 2025
59ad706
fix: remove unused property history blocks
tiensonqin Feb 19, 2025
d1b9ead
enhance(rtc): replace console.log and prn with lambdaisland.glogi
RCmerci Feb 19, 2025
6cf56b6
Merge branch 'feat/db' into enhance/reference-view
tiensonqin Feb 19, 2025
24f0eff
fix: class/property view migrate
tiensonqin Feb 19, 2025
a838edd
fix: multiple views created if there's no view yet
tiensonqin Feb 19, 2025
030fbff
fix: multiple views created
tiensonqin Feb 19, 2025
e5c339e
fix: support both page filter and view filter
tiensonqin Feb 19, 2025
753abd2
fix: importer failing when property-pages/* config present
logseq-cldwalker Feb 19, 2025
54c6c96
fix: show references view when page references are excluded
tiensonqin Feb 19, 2025
a7f81ff
fix: add persistent :migrate-new-block-uuid
tiensonqin Feb 19, 2025
1b72337
enhance: fade in table footer to avoid ui jitter
tiensonqin Feb 19, 2025
e7fd87b
fix: restore scroll pos if only triggered by back/forward buttons
tiensonqin Feb 19, 2025
79d0008
Merge branch 'feat/db' into enhance/reference-view
tiensonqin Feb 19, 2025
ef43f99
fix: lint
tiensonqin Feb 19, 2025
4829f85
fix: lint
tiensonqin Feb 19, 2025
18db6b1
chore: mv db namespaces common to both graphs to logseq.db.common
logseq-cldwalker Feb 18, 2025
73cff9d
chore: mv file-specific vars in db dep
logseq-cldwalker Feb 18, 2025
0964331
chore: move 2 more db namespaces to db.common
logseq-cldwalker Feb 19, 2025
e92b107
fix: entity-util/{journal?,whiteboard?,page?} calls
logseq-cldwalker Feb 19, 2025
b2d5315
enhance(dev): add deps/db/src/logseq/{frontend,sqlite} to
logseq-cldwalker Feb 19, 2025
9750a59
Merge pull request #11749 from logseq/refactor/db-dep-defaults-to-db-…
logseq-cldwalker Feb 19, 2025
51cbb08
enhance(ux): weighted sorting for the marketplace plugins
xyhp915 Feb 20, 2025
fdda66a
enhance(ux): weighted sorting for the marketplace plugins
xyhp915 Feb 20, 2025
d050394
perf: render objects tabs first
tiensonqin Feb 20, 2025
a3664cc
enhance: render table footer after table body has been rendered
tiensonqin Feb 20, 2025
20d483f
Merge branch 'feat/db' into enhance/reference-view
tiensonqin Feb 20, 2025
82bcea2
fix: lint
tiensonqin Feb 20, 2025
6944ec7
Merge branch 'feat/db' into enhance/reference-view
tiensonqin Feb 20, 2025
7e27e5a
fix: lint
tiensonqin Feb 20, 2025
d567261
enhance: make build-db-initial-data idempotent (#11750)
RCmerci Feb 20, 2025
bd779e3
Merge branch 'feat/db' into enhance/reference-view
tiensonqin Feb 20, 2025
69f2f49
fix: lint
tiensonqin Feb 20, 2025
e68f73b
enhance: impl IPrintWithWriter for missionary.Cancelled
RCmerci Feb 20, 2025
37e2c95
fix: show more actions if either a table view or having columns
tiensonqin Feb 20, 2025
9c77b21
enhance: show task status when referencing the task
tiensonqin Feb 20, 2025
3ceb147
fix: Can't see selection in expanded block ref in sidebar
tiensonqin Feb 20, 2025
32f56f0
fix: Page property autocomplete not filtering
tiensonqin Feb 20, 2025
b21960a
fix(regression): query result table view not rendered on file graphs
tiensonqin Feb 20, 2025
9de2361
fix(regression): {{function}} no longer works
tiensonqin Feb 20, 2025
2346df2
fix(regression): Query tables look smushed together
tiensonqin Feb 20, 2025
226e268
fix: positioned properties height
tiensonqin Feb 20, 2025
46e88dc
Revert "fix: add workaround to hide buggy pages in file graphs"
logseq-cldwalker Feb 20, 2025
abb52d6
fix: block add button not shown when the last child is embeded block
tiensonqin Feb 20, 2025
8f6a7d8
fix: mod+e to embed block
tiensonqin Feb 20, 2025
04b832f
chore: mv file graph specific fns out ldb
logseq-cldwalker Feb 20, 2025
cdf6183
enhance: export+import refs in property values
logseq-cldwalker Feb 20, 2025
0ccb59a
fix: merging exports for same journal
logseq-cldwalker Feb 20, 2025
1256d2e
enhance(ux): weighted sorting for the marketplace plugins
xyhp915 Feb 21, 2025
531f586
enhance(ux): friendly downloads number label
xyhp915 Feb 21, 2025
819b177
fix: unable to delete first child block
RCmerci Feb 21, 2025
de21b0a
fix lint
RCmerci Feb 21, 2025
6d4062c
chore: update goog-define vars
RCmerci Feb 21, 2025
dc078b5
fix: wrong check with has-tag?
tiensonqin Feb 21, 2025
9c44dbc
enhance(ux): upgrade react virtuoso library
xyhp915 Feb 21, 2025
38664c7
fix: tests
tiensonqin Feb 21, 2025
28730b8
fix: use rtc production configuration for test
tiensonqin Feb 21, 2025
1c40777
fix: set source-map-include-sources-content to true for test site
tiensonqin Feb 21, 2025
a483a41
fix: import blocks with :build/page property values
logseq-cldwalker Feb 21, 2025
054c8c4
fix: importing more than once created duplicate pages
logseq-cldwalker Feb 21, 2025
05037c4
Merge branch 'feat/db' into enhance/reference-view
logseq-cldwalker Feb 21, 2025
12c17f2
fix: misplaced docstring + outdated ignore
logseq-cldwalker Feb 21, 2025
d229037
fix: sort view by updated-at by default
tiensonqin Feb 24, 2025
4e629dd
enhance(ui): set active state for the popup trigger
xyhp915 Feb 24, 2025
2d1c3bf
chore: remove debug
xyhp915 Feb 24, 2025
3428e74
enhance: show pages count in all pages
tiensonqin Feb 24, 2025
3761194
Rename view/identity to view/feature-type
tiensonqin Feb 24, 2025
38c7416
Merge branch 'feat/db' into enhance/reference-view
tiensonqin Feb 24, 2025
bab1b93
fix: lint
tiensonqin Feb 24, 2025
aff519f
fix: links refs view crash
tiensonqin Feb 24, 2025
71c21e0
fix: list view shouldn't care about queries
tiensonqin Feb 24, 2025
1e30942
fix: indent block breadcrumb
tiensonqin Feb 24, 2025
8053942
Merge pull request #11739 from logseq/enhance/reference-view
tiensonqin Feb 24, 2025
2415270
fix: display sync icon only if current graph is an rtc one
tiensonqin Feb 24, 2025
d11bdc4
fix: File graphs repeatedly add `collapsed` properties
tiensonqin Feb 24, 2025
0d57b2a
Revert "fix: set source-map-include-sources-content to true for test …
tiensonqin Feb 24, 2025
88f507d
enhance: add padding right to block container
tiensonqin Feb 24, 2025
bd9f980
enhance: tweak words
tiensonqin Feb 24, 2025
8bf2b0c
Revert "enhance: tweak words"
tiensonqin Feb 24, 2025
826985b
enhance: view time filters support 1 day and 3 days ago
tiensonqin Feb 24, 2025
90c83b6
enhance: datetime property support custom date filter
tiensonqin Feb 24, 2025
196ffdf
fix(rtc): delete-assets api, schema-version parameter is missing
RCmerci Feb 24, 2025
a1052b2
chore: better naming
RCmerci Feb 24, 2025
e93417b
fix: prefer kv/graph-uuid to determine whether a rtc graph
tiensonqin Feb 24, 2025
66b5983
enhance(rtc): stop rtc when user logout
RCmerci Feb 21, 2025
ef7c688
enhance(rtc): stop rtc when logout or graph-switch
RCmerci Feb 22, 2025
2593595
fix(rtc): ensure started-dfv won't get stuck
RCmerci Feb 22, 2025
ce4f2c3
enhance(rtc): add :auto-start-rtc-if-possible background-task
RCmerci Feb 22, 2025
d83ced9
enhance(rtc): debounce trigger-start-rtc-flow to dedupe
RCmerci Feb 23, 2025
7d9e453
fix: ensure token not empty
RCmerci Feb 24, 2025
f5ea424
chore: remove deleted translations from #11739
logseq-cldwalker Feb 24, 2025
87c09dc
fix(dev): sqlite.build doesn't detect :build/page prop values
logseq-cldwalker Feb 24, 2025
841fbdc
enhance: export+import handles nested :build/page
logseq-cldwalker Feb 24, 2025
aa5080b
fix: intermittent failure with :build-existing-tx?
logseq-cldwalker Feb 24, 2025
ab5f811
feat: cmd-k shows recently updated pages
tiensonqin Feb 25, 2025
594db1a
build-desktop-release.yml: update actions/upload-artifact to v4
CaseyLabs Feb 25, 2025
c87e622
.github/workflows: update actions/upload-artifact to v4
CaseyLabs Feb 25, 2025
8bf6662
fix: mod+p creating a new property disabled selection
tiensonqin Feb 25, 2025
cfbebe6
chore(dev): update github actions
xyhp915 Feb 25, 2025
4268cba
Merge branch 'feat/db' of https://github.com/logseq/logseq into feat/db
xyhp915 Feb 25, 2025
b4edad8
fix: can't batch set date property
tiensonqin Feb 25, 2025
4f46554
chore(dev): update github actions
xyhp915 Feb 25, 2025
e3c364e
fix: can't batch set text property
tiensonqin Feb 25, 2025
d0d404a
chore(dev): update github actions
xyhp915 Feb 26, 2025
332835f
enhance(deploy): update source map handling and adjust deployment dir…
xyhp915 Feb 26, 2025
4c2a4dc
chore(dev): github actions
xyhp915 Feb 26, 2025
290616c
enhance(ux): disable sticky table header for the list journals
xyhp915 Feb 26, 2025
a51b26c
fix(ui): sticky columns for the pin table header
xyhp915 Feb 26, 2025
1d855d0
enhance: add EDN export for any view
logseq-cldwalker Feb 26, 2025
9d09ee9
fix: file graphs showing buggy views tab
logseq-cldwalker Feb 26, 2025
3d34224
fix: remove a few more file-graph fns in db graph only namespaces
logseq-cldwalker Feb 26, 2025
1de94fa
fix(plugin): incorrect readme link for the marketplace plugins
xyhp915 Feb 27, 2025
40f84e1
enhance(ui): polish property dropdown editor
xyhp915 Feb 27, 2025
9a95448
enhance(ui): sync specific branch for the radix ui primitives
xyhp915 Feb 27, 2025
b669814
enhance(ux): popup active state for the menu items
xyhp915 Feb 27, 2025
6109eb3
enhance(ui): polish property dropdown editor
xyhp915 Feb 27, 2025
0fc8af5
refactor: remove db-graph behavior from file-graph gp-extract
logseq-cldwalker Feb 27, 2025
21f6218
enhance: add views for DB unlinked references
logseq-cldwalker Feb 27, 2025
4dca58f
chore(dev): ignored errors
xyhp915 Feb 28, 2025
d5dbd42
fix: bullet not aligned center on table view
tiensonqin Feb 28, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: sqlite.build auto-create new pages
from properties. Also fix user specified :pages-and-blocks not building
with :build-existing-tx?
  • Loading branch information
logseq-cldwalker committed Jan 30, 2025
commit 002edb103e6e0cd2d1836259452407e40ba151fc
16 changes: 9 additions & 7 deletions deps/db/src/logseq/db/sqlite/build.cljs
Original file line number Diff line number Diff line change
@@ -380,7 +380,7 @@
(vec
(mapcat
(fn [{:keys [page blocks]}]
(let [page' (if (and build-existing-tx? (:block/uuid page))
(let [page' (if (and build-existing-tx? (not (::new-page? (meta page))))
page
(merge
;; TODO: Use sqlite-util/build-new-page
@@ -391,7 +391,7 @@
(dissoc page :build/properties :db/id :block/name :block/title :build/tags)))]
(into
;; page tx
(if (and build-existing-tx? (:block/uuid page))
(if (and build-existing-tx? (not (::new-page? (meta page))))
;; Ignore existing pages until there's a use case for updating them
[]
(let [pvalue-tx-m (->property-value-tx-m page' (:build/properties page) properties all-idents)]
@@ -462,9 +462,8 @@
existing-pages (->> pages-and-blocks (keep #(get-in % [:page :block/title])) set)
new-pages (->> (mapcat val used-properties)
(mapcat (fn [val-or-vals]
(if (coll? val-or-vals)
(keep #(when (page-prop-value? %) (second %)) val-or-vals)
(when (page-prop-value? val-or-vals) (second val-or-vals)))))
(keep #(when (page-prop-value? %) (second %))
(if (set? val-or-vals) val-or-vals [val-or-vals]))))
distinct
(remove existing-pages)
(map #(hash-map :page {:block/title %})))]
@@ -498,7 +497,8 @@
(let [ensure-page-uuids (fn [m]
(if (get-in m [:page :block/uuid])
m
(assoc-in m [:page :block/uuid] (random-uuid))))
(-> (assoc-in m [:page :block/uuid] (random-uuid))
(update :page #(with-meta % {::new-page? true})))))
expand-block-children (fn [m]
(if (:blocks m)
(update m :blocks expand-build-children)
@@ -513,14 +513,16 @@
:block/title page-name
:block/uuid
(common-uuid/gen-uuid :journal-page-uuid date-int)
:block/tags :logseq.class/Journal})))))
:block/tags :logseq.class/Journal})
(with-meta {::new-page? true})))))
m))]
;; Order matters as some steps depend on previous step having prepared blocks or pages in a certain way
(->> pages-and-blocks
(map expand-journal)
(map expand-block-children)
add-new-pages-from-refs
(add-new-pages-from-properties properties)
;; This needs to be last to ensure page metadata
(map ensure-page-uuids)
vec)))