Commit Graph

54 Commits

Author SHA1 Message Date
Gabriel Horner
16248f0bd2 fix: unable to build :default property for sqlite.build
Also add tests for different built-in cases and addressed
related TODO
2024-06-18 16:29:01 -04:00
Gabriel Horner
244a86557f chore: rename :property/value to :property.value/content
property-value is widely being used to refer to the entity or value
associated with a property entity. Naming the content of a
property-entity :property/value is confusing. property-value content is
a unique name and consistent with :block/content. Also rename related
fns which had similarly confusing names
2024-06-14 18:11:20 -04:00
Gabriel Horner
9a8c91c0cc chore: mv logseq.db.sqlite.db into sqlite.cli
for more explicit name and purpose. Also updated outdated db readme
and removed unused fns in logseq.db.sqlite.db
2024-06-14 16:53:19 -04:00
Gabriel Horner
04b25a9240 chore: add basic tests for sqlite.build
and added a couple db-graph specific for query-dsl. Also
moved fns in pu that should be in db-pu
2024-06-10 11:52:39 -04:00
Gabriel Horner
916fef8336 enhance: generate any outline structure with :build/children
Already useful for testing and will be for more interesting generation
cases
2024-06-05 12:15:12 -04:00
Gabriel Horner
05227f475b chore: mv more tests to appropriate dep enabled by :build/journal 2024-06-04 12:02:25 -04:00
Gabriel Horner
14222a546f enhance: make journals easier to generate with :build/journal
Use it in tests that more appropriately belong in db dep.
Also did minor cleanup around page prep for page-uuids
2024-06-04 12:02:25 -04:00
Gabriel Horner
13066001cd fix: storing and querying of :number property values 2024-06-03 17:41:32 -04:00
Gabriel Horner
df10beb325 enhance: add schema and validation to sqlite.build
Also renamed block-level keys that are specific to the ns to have
a :build namespace. A lot easier to read, maintain and extend later.
Also cleaned up page naming to consistently require :block/original-name
2024-06-03 12:46:53 -04:00
Gabriel Horner
a67e2c8c23 chore: use easier way to build db graph test data
in rules tests
2024-06-03 12:46:53 -04:00
Gabriel Horner
2456deb097 enhance: create sqlite.build ns as a better
load-test-files helper for db graphs and deps.
Most of this ns is split off from create-graph.
Migrated pipeline-test to correct outliner dep and
moved previous pipeline-test to correct db dep
2024-06-03 12:46:53 -04:00
Gabriel Horner
0fc01b94a3 fix: tests 2024-05-23 09:45:38 -04:00
Gabriel Horner
d37df950fa fix: property rules now work with property ref values
Also remove use of :string properties in tests
2024-05-16 15:05:37 -04:00
Gabriel Horner
2117245b28 fix: fetching built-in property values
Fixes :number properties like hl-stamp and hl-page which returned
refs instead of actual values. This will also fix it for
future usage of built-in :default props. Also fixed a db test
2024-05-15 12:23:14 -04:00
Gabriel Horner
45bb11d28d fix: db tests and :op typo 2024-05-13 17:05:32 -04:00
Gabriel Horner
efcffd6e19 fix: rules and most db tests
caused by property pair revert 5d4ae66d86
2024-04-30 10:33:33 -04:00
Gabriel Horner
cb22dca5e0 fix: db tests 2024-04-25 09:39:02 -04:00
Tienson Qin
d416687b7b fix: :block/original-name shouldn't be unique
There're at least two use cases for same page original names:
1. multiple clients can create pages with the same title
2. multiple tagged blocks can have the same :block/original-name
2024-04-24 22:49:57 +08:00
Tienson Qin
8d9e6da41e refactor: use :block/type for journal pages instead of :block/journal?
breaking change:
removes :block/journal attribute
2024-04-24 20:12:15 +08:00
Gabriel Horner
4771a97d09 fix: page-property rules to use latest schema 2024-04-12 12:29:47 -04:00
Gabriel Horner
354c0c1e42 fix: built-in? helper and most deps tests
Also fix validate script's count
2024-04-12 10:04:43 -04:00
Gabriel Horner
e07fd51c83 fix: new db graph creates properties correctly
Also fix basic validation
2024-04-11 17:42:51 -04:00
Gabriel Horner
009e5b6d62 enhance: consistently create sanitized property ident
for new properties. Also made build-new-property easier to
use by making property name optional
2024-04-05 16:55:40 -04:00
Gabriel Horner
e7bd84850d chore: clean up repeated uses of db attribute properties 2024-04-05 14:04:33 -04:00
Gabriel Horner
6045969179 fix: db tests and rename empty-placeholder to
be consistent with other ident namespaces
2024-04-05 09:36:05 -04:00
Gabriel Horner
7c1f52d2a4 chore: add format to build-new-page
every use of it was adding it manually
2024-04-04 09:25:20 -04:00
Gabriel Horner
3e504f5ab9 dev: add more tests for page-property rule 2024-04-04 09:22:39 -04:00
Gabriel Horner
c448e9a0d0 enhance: convert has-page-property rule with tests
also started on page-property rule. Tests confirm that
binding won't be an issue unlike the previous version
of these rules
2024-04-03 17:20:44 -04:00
Gabriel Horner
c4fc3a193e fix: new graph should be valid
closed values were invalid. Also fixed a couple db tests
2024-04-01 16:40:01 -04:00
Gabriel Horner
eecb510ccb enhance: built-in properties are indexed by :db/ident
built-in-properties are identified by their :db/ident instead
of :block/name. This removes reliance on :block/name and allows
us to consistently use namespaces when identifying built-in properties

:visible was renamed to :public? and is now included in :block/schema to
allow for querying. Also added a couple more new graph tests and tweaked
CI for db dep
2024-03-27 15:03:18 -04:00
Gabriel Horner
9b8540921e enhance: more property helper fns uses db-ident
instead of name
2024-03-25 16:34:51 -04:00
Gabriel Horner
dd1b0ea5f0 enhance: validate :db/ident namespaces
also add test for a new graph to be valid under malli-schema
2024-03-25 08:56:55 -04:00
Tienson Qin
ab5022066a fix: use persisted db schema instead of the current one in code 2024-03-24 15:20:34 +08:00
Gabriel Horner
4ba9fea065 enhance: all default db idents are namespaced under logseq
Having consistent namespacing of core idents increases the
number of features they can be used for later
2024-03-18 22:57:24 -04:00
Gabriel Horner
f63095316b enhance: all built-in closed values have same db/ident naming convention
Follow convention started by :task/status. Added tests to enforce this
convention as well as other db/ident conventions
2024-03-18 22:57:23 -04:00
Gabriel Horner
b34325be77 fix: two bugs with updating tags during import
fixes LOG-3073
2024-03-01 15:51:19 -05:00
Gabriel Horner
58b2888729 fix: test and lints
also remove unused binding not caught by linter b/c it's used
2024-02-07 12:23:14 -05:00
Gabriel Horner
b1bcc1b2dd fix: unit test, lint + script 2024-02-07 04:09:01 +08:00
Gabriel Horner
cdddce0120 fix deps db test and most lints
Also deleted duplicated gp-util.{page-ref,block-ref} files that were moved to common
and moved a related test to common dep
2024-01-11 14:35:04 -05:00
Tienson Qin
9ee04feeb5 Merge branch 'feat/db' into refactor/pipeline-worker 2024-01-10 16:13:56 +08:00
Tienson Qin
b7d9098e80 Move gp-util and gp-config to the common dep 2024-01-03 16:38:05 +08:00
Gabriel Horner
ff5430cfd7 fix: db lint and tests from #10683 2024-01-02 15:42:36 -05:00
Gabriel Horner
ffa6aaae29 fix: remove unused db.sqlite related fns
- remove sqlite-db/close! as its not used and didn't make sense to be
  used in other electron ns
- remove sqlite-db/connections atom as its not needed
- remove read-graph as its not necessary
- rename cli.persist-graph as its primary purpose has changed
- update effected scripts
2023-12-13 12:06:24 -05:00
Gabriel Horner
36a553e4a1 chore merge sqlite-restore into sqlite-db
Also use it on the frontend. Also remove another unnecessary sqlite.db fn
2023-12-12 15:41:02 -05:00
Gabriel Horner
fb3e8e8d8a fix: update ds sqlite persistance to match latest frontend
also removed unused util fns
2023-12-11 13:52:26 -05:00
Gabriel Horner
b5eabc80ee fix: db and graph-parser nbb tests to pass locally
Updated sqlite fns to use updated approach. Deleted some unused
fns from old approach
2023-12-11 13:51:47 -05:00
Gabriel Horner
48009adaf9 chore: reuse common helper for stringifying datoms 2023-07-20 18:37:22 -04:00
Gabriel Horner
dc2707e398 Remove unused :page_uuid datoms 2023-07-18 13:38:30 -04:00
Gabriel Horner
671453aadb Add nbb script to demonstrate datascript querying a sqlite db
Also give test vars more appropriate name
2023-07-08 16:20:42 -04:00
Gabriel Horner
47e1b06f76 Move over restore-other-data and add a test for it 2023-07-08 02:11:35 -04:00