Commit Graph

1026 Commits

Author SHA1 Message Date
Gabriel Horner
8dde33e915 chore: Update datascript to latest version before our fork
Also updated db/entity because d/entity returns nil for nonexistent ids since 1.4.2
2023-12-15 09:42:52 +08:00
Tienson Qin
a9f62baf6d wip: transact tx to disk to avoid data-loss 2023-12-15 09:39:56 +08:00
Tienson Qin
e8e553c08c Remove bak file 2023-12-14 02:14:48 +08:00
Tienson Qin
b8a6f820ad New file based graphs works with opfs db 2023-12-14 02:12:24 +08: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
Tienson Qin
f3d032d83d fix: move some fns from db.sqlite to sqlite.common-db
To remove better-sqlite3 dependency on Electron.
2023-12-14 00:34:07 +08:00
Gabriel Horner
e228bd1fb6 fix: tweak schema to be valid for new db graphs
Also reuse initialization data
2023-12-12 16:05:06 -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
a207296a42 chore: reuse some sqlite db fns
Also removed datascript db atom fetching, unused fns and dep in sqlite.db
2023-12-12 15:09:44 -05:00
Gabriel Horner
0f4cdbbadf bump outdated nbb-logseq and fix lint 2023-12-11 15:55:38 -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
e0901b9d04 bump nbb-logseq to first version
that works for forked datascript. Deps tests pass locally
without needing to rely on local builds
2023-12-11 13:52:15 -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
Tienson Qin
75c010e1c3 WIP: use OPFS db for electron 2023-12-06 15:03:29 +08:00
Tienson Qin
ea3f5973b7 Merge branch 'feat/db' into feat/datascript-storage 2023-12-06 01:10:23 +08:00
Tienson Qin
3df099a15e fix: don't retract attributes for db if block content is not updated 2023-12-05 18:07:48 +08:00
Gabriel Horner
e847c0899a enhance: bring back built-in properties using closed values
Fixes LOG-2903. Also fixed a bug with logseq.color property
not working with latest accent color
2023-12-04 17:29:41 -05:00
Gabriel Horner
2554016d63 enhance: make closed values scriptable
Added closed value examples of all 5 property types
to properties graph. Part of LOG-2903
2023-12-04 10:11:52 -05:00
Gabriel Horner
0ffce18d15 chore: rename property.type vars
- renamed schema-type to property-type as its not
  a type of schema and schema is an ambiguous context
  as it also applies to a class
- renamed builtin to built-in to be more correct
2023-11-30 16:26:44 -05:00
Gabriel Horner
f5e339293f fix: add validation for property types and :schema attributes
Part of LOG-2953. We shouldn't persist unusuable property type
configurations as shown by this bug. By enumerating what schema
attributes are allowed for each type, we can prevent future bugs
like this. When changing between property types, this also cleans up
:classes, :position and :values that were accidentally hanging around
for certain types. Also modify test since we don't allow users
to use a :default property with :cardinality
2023-11-30 16:24:11 -05:00
Gabriel Horner
d218db4e6f fix: fixes bug with unusuable :default property
Part of LOG-2953. Also fixes bug when a new property first displays
configure modal and incorrectly shows cardinality for :default property
2023-11-29 17:15:35 -05:00
Andelf
f1d763aa12 chore: comment out electron? feature gate 2023-11-30 02:29:08 +08:00
Gabriel Horner
1117ad3cb4 fix lint
also comment out print that prevented chaining query results with bb
2023-11-29 10:14:53 -05:00
Tienson Qin
e60ea3ac10 fix: remove debug assert 2023-11-29 21:03:52 +08:00
Tienson Qin
86b70e3b33 update datascript 2023-11-28 15:10:43 +08:00
Tienson Qin
716c496590 Update datascript 2023-11-28 14:57:06 +08:00
Gabriel Horner
5e547a1663 fix: open db graph urls
Also introduced var for logseq_db_ in deps
2023-11-27 10:55:22 -05:00
Tienson Qin
232c1cb4c2 wip: debug 2023-11-26 15:58:26 +08:00
Tienson Qin
a4c30bc62f Works!! 2023-11-25 14:14:02 +08:00
Tienson Qin
a408f93b26 fix: db restore 2023-11-25 11:58:11 +08:00
Tienson Qin
6ff1207339 Replace data load and transact 2023-11-25 11:51:59 +08:00
Tienson Qin
b7ce9a7ca5 fix: add transact and datoms load 2023-11-25 11:22:59 +08:00
Tienson Qin
67cb8d6213 wip: persistent datascript storage on Electron 2023-11-25 10:49:01 +08:00
Tienson Qin
40bffa32b0 Use forked datascript 2023-11-25 09:12:59 +08:00
Gabriel Horner
6c5072e7e6 fix: property completion should only include properties
Was including classes and blocks with :block/schema. Also not
hiding icon property correctly. Also updated outdated docstrings
2023-11-22 12:29:57 -05:00
Gabriel Horner
cca80e37a7 fix: remove unused :block/type "object"
fixes LOG-2914
2023-11-16 14:50:21 -05:00
Gabriel Horner
b359694c4b fix: multiple fixes for property validation
- couldn't use :default block property values
- couldn't add new closed number value
- couldn't select existing :page or :date closed values
- editor/CLI validation wasn't working - see failing db-graph-test job
- update schema for closed-value
Part of LOG-2871. Also fixed typo in ui.cljs
2023-11-15 14:55:57 -05:00
Tienson Qin
443eb3f2b8 fix: closed value validation
A closed value must be a UUID and exists in the predefined schema
values from its property.

Related to LOG-2871.
2023-11-15 22:58:05 +08:00
Gabriel Horner
86eb1b394d fix: update schema for latest changes to closed values
part of LOG-2871
2023-11-14 16:08:03 -05:00
Tienson Qin
6a47648c6c Replace enum type with available choices (#10438)
* Add type schema for enum values

* Refactor: closed values instead of enum to limit values

There's no need to add the enum type, we just want to limit the
values.

* feat: :page type supports closed values

* fix: can't set property values for text/number types

* fix: don't trigger on-chosen when unmounting any select component

* fix: can't apply both page classes limitation and closed values

* fix: merge conflicts

* fix: ui not refresh when changing closed value

* fix: can't set icon for closed value
2023-11-14 18:48:34 +08:00
Gabriel Horner
61eeb96709 fix: 3 bugs with persisting whiteboard data
- :block/uuid was a string
- no timestamps on whiteboard blocks
- no created-at on whiteboard shape blocks

Also added missing page attributes for whiteboard page. Initially I
modeled whiteboards as its own schema type with fewer page attributes
but then I noticed it got format and journal? when referenced so just
added the missing attributes. Fixes LOG-2915
2023-11-09 11:21:18 -05:00
Gabriel Horner
3162a06c3d fix: page-tags filter shouldn't show :block/link duplicates 2023-11-06 14:22:44 -05:00
Gabriel Horner
3c134d4716 enhance: Make db validation configurable
Added 3 db validation options to more aggressively notify and to provide
stricter levels of validation. Part of LOG-2818
2023-10-30 17:25:12 -04:00
Gabriel Horner
c88b0a2a4e fix: remove broken built-in enum properties from app and script
It's too complicated for now but hope to bring this back
Part of LOG-2871
2023-10-30 10:43:58 -04:00
Gabriel Horner
5f392a2260 fix: update schema to include new enum value block
Part of LOG-2871.
Also fixed create-graph failing due to renamed ns
2023-10-30 10:43:58 -04:00
Tienson Qin
8c7098b21f enhance: move enum property choices to hidden page
related to LOG-2871
2023-10-30 20:35:39 +08:00
Gabriel Horner
a6c30554af fix: 3 date related attrs missing from block schema 2023-10-27 15:13:32 -04:00
Gabriel Horner
075efcb222 fix: malli schema missing two ref attributes
Validator errored when I collapsed a property. Added a sync
check so that future changes to datascript schema alert developer
to make a change in the malli schema.
Also removed a ds attribute for DB schema
2023-10-26 15:44:14 -04:00
Gabriel Horner
d571e90d3e fix: new hidden pages showing up in search
part of LOG-2854
2023-10-26 13:58:44 -04:00
Gabriel Horner
e5e25bb403 update schema for new hidden page attributes
part of LOG-2854. Also update --closed-maps to use library fn
2023-10-26 12:05:12 -04:00