Skip to content

Commit 7f962bc

Browse files
Merge pull request #10 from logseq/feat/db
Update to database version
2 parents cdbe665 + c02b37a commit 7f962bc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+7179
-128
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,21 @@ name: CI
33

44
on:
55
push:
6+
pull_request:
7+
branches: [main]
68

79
jobs:
810
test:
911
runs-on: ubuntu-latest
1012

1113
steps:
1214
- name: Checkout
13-
uses: actions/checkout@v3
15+
uses: actions/checkout@v4
1416
with:
1517
fetch-depth: 0
16-
- uses: actions/setup-node@v3
18+
- uses: actions/setup-node@v4
1719
with:
18-
node-version: '16'
20+
node-version: '22'
1921
- name: Setup Babashka
2022
uses: turtlequeue/[email protected]
2123
with:

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
.shadow-cljs
22
node_modules
3-
lib
43
shadow-cljs.edn
54
/report.html
65
/test/libraries

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@
33
* Unless a version is noted below, versions map to nbb version as described in
44
https://github.com/logseq/nbb-logseq/blob/main/README.md#versioning.
55

6+
## Unreleased
7+
* Alpha version of nbb-logseq which supports the database version
8+
* 1.3.X nbb with more included libraries: cljs-bean.transit, rewrite-clj and ordered
9+
* Versioned as logseq/nbb-logseq#feat-db-*
10+
11+
## 1.2.173
12+
613
## 1.1.158
714
* 1.1.158 nbb with 3 new cljs-time fns for compatibility with logseq's :inputs
815

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,17 @@ $ nbb-logseq -e '(+ 1 2 3)'
3434
6
3535
```
3636

37+
## Database Version
38+
39+
To use `nbb-logseq` with [the database version](https://github.com/logseq/logseq#-database-version), specify the version as `logseq/nbb-logseq#feat-db-v24`. This version is only available through github and has not been released to npm. An npm version will be released when the database version has a desktop release.
40+
41+
Unlike file graphs, DB graphs can be written by scripts. This is powerful and opens up more use cases for scripting. To write your own script, you'll need a package.json and nbb.edn. Use [this example package.json](https://github.com/logseq/publish-spa/blob/feat/db/package.json) and [this example nbb.edn](https://github.com/logseq/publish-spa/blob/feat/db/nbb.edn). Some example database graph scripts:
42+
43+
* https://github.com/logseq/logseq/tree/master/deps/db/script - Scripts to query, validate and create any graph
44+
* https://github.com/logseq/logseq/blob/master/deps/outliner/script/transact.cljs - Script to transact (modify) nodes queried from the commandline
45+
* https://github.com/logseq/logseq/tree/master/scripts/src/logseq/tasks/db_graph - More complex scripts to generate graphs with all property types or with schema.org's ontology. See [this readme](https://github.com/logseq/logseq/tree/master/scripts#nbb-scripts) for using these.
46+
* [Example querying a LLM and a schema.org based DB graph](examples/ollama-chat/)
47+
3748
## Dependency Management
3849

3950
`nbb-logseq` can use libraries from both NPM and ClojureScript. For NPM

bb.edn

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,30 @@
22
:deps
33
{nbb.build/nbb.build
44
{:git/url "https://github.com/babashka/nbb"
5-
:git/sha "35e4e94966d0ae45bb87569940b7c1fb05c19467"
5+
:git/sha "9119dbe9b5f660cb77d29058b3b762978ee4b939"
66
:deps/root "build"}
77
#_{:local/root "../nbb/build"}
88
nbb/nbb
99
{:git/url "https://github.com/babashka/nbb"
10-
:git/sha "35e4e94966d0ae45bb87569940b7c1fb05c19467"
11-
:git/tag "v1.2.173"}
10+
:git/sha "9119dbe9b5f660cb77d29058b3b762978ee4b939"}
1211
#_{:local/root "../nbb"}
12+
org.babashka/sci
13+
{:mvn/version "0.8.41"}
1314
datascript/deps
14-
{:git/url "https://github.com/babashka/nbb-features"
15-
:git/sha "912ca86f1744b80d58d2c5c613df3a77d9f8624e"
15+
{:git/url "https://github.com/logseq/nbb-features"
16+
:git/sha "c16679a2f7327830a88fb61688e69e86eea015a0"
1617
:deps/root "features/datascript"}
18+
#_{:local/root "../nbb-features/features/datascript"}
1719
datascript-transit/deps
18-
{:git/url "https://github.com/babashka/nbb-features"
19-
:git/sha "912ca86f1744b80d58d2c5c613df3a77d9f8624e"
20+
{:git/url "https://github.com/logseq/nbb-features"
21+
:git/sha "c16679a2f7327830a88fb61688e69e86eea015a0"
2022
:deps/root "features/datascript-transit"}
21-
cljs-time/deps {:local/root "features/cljs-time"}}
23+
#_{:local/root "../nbb-features/features/datascript-transit"}
24+
cljs-time/deps {:local/root "features/cljs-time"}
25+
;; nbb comes with cljs-bean but not cljs-bean.transit
26+
cljs-bean-transit/deps {:local/root "features/cljs-bean-transit"}
27+
rewrite-clj/deps {:local/root "features/rewrite-clj"}
28+
ordered/deps {:local/root "features/ordered"}}
2229

2330
:tasks
2431
{:requires ([babashka.fs :as fs]

examples/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ nbb-logseq query.cljs docs '[:find (pull ?b [*]) :where [?b :block/marker]]'
1717
{:timestamps [], :properties [], :start-pos 774, :end-pos 824},
1818
:block/format :markdown,
1919
:block/level 3,
20-
:block/content "LATER [#A] research balalah is a top priority",
20+
:block/title "LATER [#A] research balalah is a top priority",
2121
:db/id 6361,
2222
:block/path-refs [{:db/id 5} {:db/id 14} {:db/id 1969}],
2323
:block/parent {:db/id 6360},

examples/fly-io/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ bb '(->> *input* (map :block/properties))'
4545
To try this service locally on your Logseq graph:
4646

4747
1. Install [babashka](https://github.com/babashka/babashka) >= 0.8.156.
48-
2. Install node.js >= 16.3.1.
48+
2. Install node.js >= 22.
4949
3. Run `npm install` to install npm dependencies.
5050
4. Clone your graph: `git clone YOUR-GRAPH resources/graph`
5151
* If you don't have a graph, try the Logseq docs

examples/fly-io/nbb.edn

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{:deps
22
{logseq/graph-parser
33
{:git/url "https://github.com/logseq/logseq"
4-
:git/sha "82cf4d3c65acbf230a3170640fe271dd74095067"
5-
:git/tag "0.9.8"
4+
:git/sha "65640ed8857199d89268295863cd556f5d90ea0b"
65
:deps/root "deps/graph-parser"}
7-
#_{:local/root "../../../logseq/deps/graph-parser"}}}
6+
#_{:local/root "../../../logseq/deps/graph-parser"}}}

examples/fly-io/package-lock.json

Lines changed: 23 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/fly-io/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"name": "mysite",
33
"dependencies": {
4-
"@logseq/nbb-logseq": "^1.1.155",
4+
"@logseq/nbb-logseq": "logseq/nbb-logseq#feat-db-v24",
55
"express": "^4.18.1",
6-
"mldoc": "1.5.1"
6+
"mldoc": "1.5.9"
77
},
88
"scripts": {
99
"test": "echo \"Error: no test specified\" && exit 1",

0 commit comments

Comments
 (0)