You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: db-version.md
+49-12Lines changed: 49 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
## Description
2
2
3
-
This page describes DB (database) graph functionality as of July 3rd. See [here](https://test.logseq.com/#/) to try the latest stable version. If you're an existing user of Logseq, you'll be interested in [changes with the db version](./db-version-changes.md).
3
+
This page describes DB (database) graph functionality as of Aug 29th. See [here](https://test.logseq.com/#/) to try the latest stable version. If you're an existing user of Logseq, you'll be interested in [changes with the db version](./db-version-changes.md).
4
4
5
5
NOTE: While there is an [automated backup](#automated-backup) for DB graphs, we recommend only using DB graphs for testing purposes.
6
6
@@ -21,13 +21,16 @@ NOTE: While there is an [automated backup](#automated-backup) for DB graphs, we
21
21
*[Views](#views)
22
22
*[Tables](#tables)
23
23
*[Library](#library)
24
+
*[Search Commands](#search-commands)
25
+
*[Semantic Search](#semantic-search)
24
26
*[DB Graph Importer](#db-graph-importer)
25
27
*[Automated Backup](#automated-backup)
26
28
*[Export and Import](#export-and-import)
27
29
*[Graph Export](#graph-export)
28
30
*[Graph Import](#graph-import)
29
31
*[EDN Data Export](#edn-data-export)
30
32
*[Scripting](#scripting)
33
+
*[CLI](#cli)
31
34
*[Additional Links](#additional-links)
32
35
33
36
## Nodes
@@ -43,13 +46,15 @@ A node is a new term for a page or block because the two now behave similarly. N
43
46
* Nodes are embedded with the same `/Node embed` command.
44
47
* Nodes are collapsible with an arrow on the left that appears on hover.
45
48
49
+
Blocks that have a page as a parent i.e. usually top-level blocks can be converted to a page and back to a block easily. To convert this block to a page, simply tag the block with `#Page`. This also makes the newly created a page a namespaced page under its parent(s). For example, if the block `b1` on the journal `Aug 29th, 2025` is converted to the page, `b1` becomes a namespaced page in the [Library](#library) with parent `Aug 29th, 2025`. To convert this type of page back to a block, press `p t` and remove `#Page` from the node.
50
+
46
51
Blocks and pages still have some differences that we are hoping to unify like the block view when it is zoomed in.
47
52
However, blocks and pages will have some differences as noted in the [pages](#pages) and [blocks](#blocks) sections.
48
53
49
54
### Pages
50
55
51
56
Things that are specific to pages:
52
-
* Pages have a dedicated view called `All pages`.
57
+
* Pages have a dedicated view called `Pages`.
53
58
* When a property, new tag, journal or whiteboard are created, they are created as a page.
54
59
* Pages are unique as follows:
55
60
* Page names are unique by tag e.g. there can be `Apple #Company` and `Apple #Fruit`.
@@ -80,9 +85,10 @@ A property itself can have properties on its property page. By default the `Desc
80
85
81
86
### Property Shortcuts
82
87
83
-
*`Cmd-p` is useful for quickly adding properties to a block or a page. You can create or select existing properties from it. Keybinding is `Ctrl-Alt-p` on Linux and Windows.
84
-
*`Cmd-j` is useful for quickly editing block or page properties from the keyboard. After pressing `Cmd-j`, choose which property or property value by typing the letters in the bubble next to it e.g. `c` or `ab`.
85
-
*`p t` toggles displaying all the current node's properties below it. This is useful to quickly view properties that are hidden or in a different position.
88
+
*`Cmd-p` quickly adds properties to the current node or selected nodes. You can create or select existing properties from it. Keybinding is `Ctrl-Alt-p` on Linux and Windows.
89
+
*`Cmd-j` quickly edits block or page properties from the keyboard. After pressing `Cmd-j`, choose which property or property value by typing the letters in the bubble next to it e.g. `c` or `ab`.
90
+
*`p a` toggles displaying all the current node's properties below it. This is useful to quickly view properties that are hidden or in a different position.
91
+
*`p t` adds or removes or tags to the current node or selected nodes.
86
92
*`p i` opens the icon picker to set an icon for the current node.
87
93
* See [task shortcuts](#task-shortcuts) for task specific ones.
88
94
* To navigate between property values across nodes, use the up and down arrow keys.
@@ -95,7 +101,7 @@ Properties are configurable wherever they are used by clicking on its name to di
95
101
96
102
Property fields in the dropdown menu:
97
103
98
-
*`Name`: Name to visually identify the property
104
+
*`Property name`: Name to visually identify the property
99
105
*`Property type`: This determines what type a property's property values will have. Once a property is used this field cannot change. If you're unsure of what type to choose, use `Text`. See [property-types](#property-types) for more.
100
106
*`Default value`: This sets the default value for a property. See [property-default-values](#property-default-values) for more.
101
107
*`Available choices`: This limits a property to only have one of the defined choices. See [property choices](#property-choices) for more.
@@ -330,7 +336,7 @@ Nodes can also be selected and have bulk actions in [tables](#tables).
330
336
331
337
Views are a powerful way to visualize a group of nodes in different ways. A view can switch between the following view types: `Table View`, `List View` or `Gallery View`. Most views default to the [Table View](#tables). The `List View` displays nodes in an outliner with nodes grouped by pages. The `Gallery View` is useful for viewing blocks as square tiles, especially for assets.
332
338
333
-
Views are used in a number of features including queries, (un)linked references, property and tag pages and `All pages`. For all these features except queries, multiple views can be created. Regardless of which view type you're in, a view's header has these common actions from left to right:
339
+
Views are used in a number of features including queries, (un)linked references, property and tag pages and `Pages`. For all these features except queries, multiple views can be created. Regardless of which view type you're in, a view's header has these common actions from left to right:
334
340
335
341
*`View name`: A view's name is editable by clicking on it and renaming it. A view can also be deleted from here.
336
342
*`New view`: Click on `+` to create a new view. Since a view is fairly customizable, this is useful for creating different views on the same nodes and to view a specific subgroup of nodes with filters.
@@ -344,6 +350,8 @@ Views are used in a number of features including queries, (un)linked references,
344
350
*`Group by`: Group by a column/property and its values i.e. a different group for each property value. The different groups are vertically stacked.
345
351
* Nodes can be grouped by all property types except for `DateTime`.
346
352
* While each group is displayed as a different view, they all obey the same view-level configuration.
353
+
*`Sort groups by`: When grouping nodes by page, sort group by options including `Journal date`, `Page name` and `Page created date`.
354
+
*`Sort groups order`: When grouping nodes by page, sort groups `Ascending` or `Descending`.
347
355
*`Export EDN`: Exports the currently viewable nodes to your clipboard as [EDN Data](#edn-data-export). The exported nodes are affected by `Search` or `Filter` usage.
348
356
*`New node`: Click on the `+` icon to create a new node in the view. Different features will behave differently for this. For example, when clicked from a tag or property page, the new node will have that tag or property added to it.
349
357
@@ -365,9 +373,25 @@ A table displays a group of nodes as rows and a node's properties as columns. A
365
373
366
374
## Library
367
375
368
-
The Library is a built-in page that displays and edits namespaced pages as if they were blocks on a page. This is powerful as it allows us to use an outliner to build and organize a hierarchy of pages. This is useful for those who want to organize their pages as if they were under folders on a computer. Pages that have no common properties are a good fit for namespaces. Pages that have common properties are better organized with [new tags](#new-tags).
376
+
The `Library` is a built-in page that displays and edits namespaced pages as if they were blocks on a page. This is powerful as it allows an outliner to build and organize a hierarchy of pages. This is useful for those who want to organize their pages as if they were under folders on a computer. Pages that have no common properties are a good fit for namespaces. Pages that have common properties are better organized with [new tags](#new-tags). The following actions can be done on the `Library` page:
377
+
378
+
* Add to the Library with the `Add existing pages to Library` button.
379
+
* Delete from the Library by selecting a block and pressing `Backspace` or `Cmd-X`. This also deletes the page's relationship to its namespace. This does not delete the page.
380
+
381
+
## Search Commands
382
+
383
+
Search commands run commands from the [Search modal](https://docs.logseq.com/#/page/search). To invoke a search command, press `Cmd+Shift-P` on Mac/Linux or `Ctrl+Shift-P` on Windows, type the command and press `Enter`. The following commands are new and only for DB graphs unless otherwise noted:
384
+
385
+
* Command `Quick add` - Opens a modal to quickly jot down notes without losing context. This feature is in its own tab in the mobile app. The modal's contents are sent to the current journal day by pressing a button or the keybinding `Cmd-E`.
386
+
* Command `Customize appearance` - Opens a modal to edit appearance related settings.
387
+
* Command `Move blocks to` - Moves the current or selected nodes to the chosen page. Also available for file graphs.
388
+
* Commands from [property shortcuts](#property-shortcuts).
389
+
* Commands from [edn data export](#edn-data-export).
390
+
* For developers, there are `Validate current graph` and `Garbage collect graph` commands.
391
+
392
+
## Semantic Search
369
393
370
-
Pages that you want to namespace can be added to the Library with the `Add existing pages to Library` button.
394
+
[Search](https://docs.logseq.com/#/page/search) can optionally do a semantic search. To enable this, go to `Settings > AI` and choose a _local_ AI model. This feature is available on browsers that are [WebGPU capable](https://caniuse.com/webgpu) and the desktop.
371
395
372
396
## DB Graph Importer
373
397
@@ -389,11 +413,10 @@ The DB Graph Importer converts a file graph to a DB graph. An overview of what i
389
413
### Importer Todos
390
414
391
415
There are existing features that have a database equivalent that are still a TODO for the importer:
392
-
* Import pdf annotations as `#PDF Annotation`
393
-
* Import org mode files
394
416
* Import text files e.g. *.txt or *.edn
395
417
* Query macros and related query filters that have changed
396
418
* Import templates
419
+
* Import org mode files
397
420
398
421
### Convert File Graph to DB graph
399
422
@@ -447,7 +470,7 @@ Exported [EDN data](https://github.com/edn-format/edn) allows any DB graph conte
447
470
448
471
This feature is also available:
449
472
* for the whole graph using the `Export EDN file` and `EDN to DB graph` options described above.
450
-
* from any [view](#views) as a header action. For example, go to the `All pages` view and filter it to only export the viewable pages.
473
+
* from any [view](#views) as a header action. For example, go to the `Pages` view and filter it to only export the viewable pages.
451
474
* for multiple selected nodes with the `Copy / Export as` modal.
452
475
453
476
For developers, this shareable EDN data can also be used in scripts to create or modify existing graphs. For example, a page's data could be passed to [this script](https://github.com/logseq/logseq/blob/master/deps/db/script/create_graph.cljs) to create a new DB graph with that page.
@@ -464,6 +487,20 @@ On desktop, it is easy to modify an existing DB graph with a script and see the
464
487
2. Modify the db.sqlite with a nbb-logseq script.
465
488
3. Update the app to use the modified db.sqlite by using the `Replace graph with its db.sqlite file` dev command.
466
489
490
+
## CLI
491
+
492
+
The `logseq`[CLI](https://www.npmjs.com/package/@logseq/cli) provides commands to interact with desktop DB graphs from the command line. The CLI works independent of the Logseq app and makes Logseq features available for automation on CI/CD platforms like [Github Actions](https://github.com/features/actions). For example, a DB graph could have a Markdown export created on every push to Github. Some CLI commands also interact with the current DB graph if the [HTTP API Server](https://docs.logseq.com/#/page/local%20http%20server) is turned on. The CLI provides the following commands including:
493
+
494
+
* list - List graphs
495
+
* show - Show DB graph(s) info
496
+
* search - Search DB graph like grep
497
+
* query - Query DB graph
498
+
* export - Export DB graph as Markdown
499
+
* export-edn - Export DB graph as EDN
500
+
* append - Append text to current page
501
+
502
+
Read the [CLI's homepage](https://www.npmjs.com/package/@logseq/cli) to learn more.
503
+
467
504
## Additional Links
468
505
*https://discuss.logseq.com/t/introducing-newtags-with-examples/32310 - Helpful tutorial on new tags
469
506
*https://github.com/C0ntr0lledCha0s/logseq-template-graph - Example graph with useful properties and tags. Import graph as EDN.
0 commit comments