Skip to content

Commit ef96a8d

Browse files
chore: remove db scripts made redundant by CLI
1 parent 61daa0a commit ef96a8d

5 files changed

Lines changed: 3 additions & 139 deletions

File tree

.github/workflows/build.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,11 +172,12 @@ jobs:
172172
- name: Fetch deps/db yarn deps
173173
run: cd deps/db && yarn install --frozen-lockfile
174174

175+
# Can run from deps/db since all JS deps for this command are available in deps/db
175176
- name: Validate created DB graphs
176-
run: cd deps/db && yarn nbb-logseq script/validate_db.cljs ../../scripts/properties-graph ../../scripts/schema-graph --closed-maps --group-errors
177+
run: cd deps/db && yarn nbb-logseq -cp src:../cli/src -m logseq.cli validate -g ../../scripts/schema-graph
177178

178179
- name: Export a created DB graph
179-
run: cd deps/db && yarn nbb-logseq script/export_graph.cljs ../../scripts/properties-graph -f properties.edn -T
180+
run: cd deps/db && yarn nbb-logseq -cp src:../cli/src -m logseq.cli export-edn -g ../../scripts/properties-graph -f properties.edn -T
180181

181182
- name: Create graph from the export and diff the two graphs
182183
run: cd deps/db && yarn nbb-logseq -cp src:../outliner/src:script script/create_graph.cljs ./properties-graph2 properties.edn -iv && yarn nbb-logseq script/diff_graphs.cljs ../../scripts/properties-graph ./properties-graph2 -T

bb.edn

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,6 @@
6767
(run '-dev:publishing-dev {:parallel true})
6868
(run '-dev:publishing-release))}
6969

70-
dev:validate-db
71-
{:doc "Validate a DB graph's datascript schema"
72-
:requires ([babashka.fs :as fs])
73-
:task (apply shell {:dir "deps/db" :extra-env {"ORIGINAL_PWD" (fs/cwd)}}
74-
"yarn -s nbb-logseq script/validate_db.cljs"
75-
*command-line-args*)}
76-
7770
dev:db-query
7871
{:doc "Query a DB graph's datascript db"
7972
:requires ([babashka.fs :as fs])
@@ -92,12 +85,6 @@
9285
:task (apply shell {:dir "deps/db" :extra-env {"ORIGINAL_PWD" (fs/cwd)}}
9386
"yarn -s nbb-logseq -cp src:../outliner/src:script script/create_graph.cljs" *command-line-args*)}
9487

95-
dev:db-export
96-
{:doc "Export a DB graph to a sqlite.build EDN file"
97-
:requires ([babashka.fs :as fs])
98-
:task (apply shell {:dir "deps/db" :extra-env {"ORIGINAL_PWD" (fs/cwd)}}
99-
"yarn -s nbb-logseq script/export_graph.cljs" *command-line-args*)}
100-
10188
dev:db-diff
10289
{:doc "Diffs two DB graphs"
10390
:requires ([babashka.fs :as fs])

deps/db/script/export_graph.cljs

Lines changed: 0 additions & 62 deletions
This file was deleted.

deps/db/script/validate_db.cljs

Lines changed: 0 additions & 51 deletions
This file was deleted.

docs/dev-practices.md

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -337,17 +337,6 @@ These tasks are specific to database graphs. For these tasks there is a one time
337337
$ cd deps/db && yarn install && cd ../outliner && yarn install && cd ../graph-parser && yarn install && cd ../..
338338
```
339339

340-
* `dev:validate-db` - Validates a DB graph's datascript schema
341-
342-
```sh
343-
# One or more graphs can be validated e.g.
344-
$ bb dev:validate-db test-db schema
345-
Read graph test-db with 1572 datoms, 220 entities and 13 properties
346-
Valid!
347-
Read graph schema with 26105 datoms, 2320 entities and 3168 properties
348-
Valid!
349-
```
350-
351340
* `dev:db-query` - Query a DB graph
352341

353342
```sh

0 commit comments

Comments
 (0)