commit18c0762f6eAuthor: Tienson Qin <tiensonqin@gmail.com> Date: Tue Apr 22 16:29:27 2025 +0800 chore: bump datascript commitbe66b5e6c0Author: Tienson Qin <tiensonqin@gmail.com> Date: Tue Apr 22 09:56:45 2025 +0800 chore: bump datascript commit6788818aecAuthor: Tienson Qin <tiensonqin@gmail.com> Date: Mon Apr 21 23:22:48 2025 +0800 enhance: property keyboard navigation (#11825) Keyboard enhancements: 1. UP/DOWN to navigate between blocks and properties, the property value will be focused and highlighted 2. Backspace/Delete to delete a property value and move it to the nearest property or block above 3. Enter/Space to open datetime and select type property value commit727391fe7aAuthor: Tienson Qin <tiensonqin@gmail.com> Date: Mon Apr 21 18:01:05 2025 +0800 fix: don't show breadcrumb for pages when tagging commit615e2a392eAuthor: Tienson Qin <tiensonqin@gmail.com> Date: Mon Apr 21 17:55:51 2025 +0800 enhance(ux): display existing choices when choosing node property commit30d230380fAuthor: Tienson Qin <tiensonqin@gmail.com> Date: Sun Apr 20 23:21:50 2025 +0800 perf: skip db persistent for previous actions in pipeline commit0df1208ae6Author: Tienson Qin <tiensonqin@gmail.com> Date: Sun Apr 20 19:32:24 2025 +0800 fix: remove d/store calls There's a bug with `d/store`: it doesn't clear `tx-tail` in the conn atom. commit7d436cf5ebAuthor: Tienson Qin <tiensonqin@gmail.com> Date: Sun Apr 20 18:03:23 2025 +0800 chore: bump datascript commit878331c53eAuthor: Tienson Qin <tiensonqin@gmail.com> Date: Sun Apr 20 12:30:11 2025 +0800 fix: block title inline commit2a8461b41aAuthor: Tienson Qin <tiensonqin@gmail.com> Date: Sun Apr 20 12:17:16 2025 +0800 fix: no way to edit the query as the settings icon doesn't show up commitf843df9482Author: Tienson Qin <tiensonqin@gmail.com> Date: Fri Apr 18 23:41:29 2025 +0800 fix: empty data not trigger query view re-render commit6042c8b112Author: Gabriel Horner <gabriel@logseq.com> Date: Fri Apr 18 09:44:27 2025 -0400 refactor: keep testing concerns in tests 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 commitc9177abc9aAuthor: Tienson Qin <tiensonqin@gmail.com> Date: Fri Apr 18 15:20:22 2025 +0800 fix: tests commitb7c45f881cAuthor: Tienson Qin <tiensonqin@gmail.com> Date: Fri Apr 18 13:19:37 2025 +0800 fix: don't show query builder for non-query blocks commit46bdd1a366Author: Tienson Qin <tiensonqin@gmail.com> Date: Fri Apr 18 13:17:07 2025 +0800 enhance: set query title && code commitabf90fbb7dAuthor: Tienson Qin <tiensonqin@gmail.com> Date: Fri Apr 18 11:47:26 2025 +0800 fix: queries don't automatically update Fix https://github.com/logseq/db-test/issues/237 This commit also updates custom queries to only fetch :db/id to improve performance. commitaa45b3fa6cAuthor: Gabriel Horner <gabriel@logseq.com> Date: Fri Apr 18 14:31:00 2025 -0400 fix(regression): paths of file graph exports markdown + opml exports had zipped files several directories deep because they used the full path of the graph commit63403bd8c5Author: Gabriel Horner <gabriel@logseq.com> Date: Fri Apr 18 12:32:51 2025 -0400 fix: remove unused workarounds from #11774 Previous commit fixed these issues commit4ad4944b4eAuthor: Gabriel Horner <gabriel@logseq.com> Date: Fri Apr 18 12:29:06 2025 -0400 fix: for file graphs, tags with blank space in the namespace parent creates entities with nil :block/title to be created. This created unexpected bugs in the UI e.g. all pages and caused duplicate content to appear. Example from test graph: 'tags:: [[Some / Namespace ]]' Fixes https://test.logseq.com/#/page/68017fb5-7b9c-448a-9f64-6bb8d8669396
Description
This library provides an API to the frontend(datascript) and backend(SQLite) databases from the Logseq app and the CLI. The majority of this library is focused on supporting DB graphs but there are a few namespaces that support file graphs. This library is compatible with ClojureScript and with nbb-logseq to respectively provide frontend and commandline functionality.
API
This library is under the parent namespace logseq.db. It provides the following namespaces:
logseq.db- main entry point serving both file and DB graphslogseq.db.frontend.*- frontend namespaces for DB graphslogseq.db.sqlite.*- backend/sqlite namespaces for DB graphslogseq.db.file-based.*- namespaces for file graphs, mostly old namespaceslogseq.db.common.*- namespaces for both file and DB graphs
Usage
See the frontend for example usage.
Dev
This follows the practices that the Logseq frontend follows. Most of the same linters are used, with configurations that are specific to this library. See this library's CI file for linting examples.
Setup
To run linters and tests, you'll want to install yarn dependencies once:
yarn install
This step is not needed if you're just running the application.
Testing
Testing is done with nbb-logseq and nbb-test-runner. Some basic usage:
# Run all tests
$ yarn test
# List available options
$ yarn test -H
# Run tests with :focus metadata flag
$ yarn test -i focus
Datalog linting
Datalog rules for the client are linted through a script that also uses the datalog-parser. To run this linter:
bb lint:rules
Managing dependencies
The package.json dependencies are just for testing and should be updated if there is new behavior to test.
The deps.edn dependencies are used by both ClojureScript and nbb-logseq. Their versions should be backwards compatible with each other with priority given to the frontend. No new dependency should be introduced to this library without an understanding of the tradeoffs of adding this to nbb-logseq.