Commit Graph

159 Commits

Author SHA1 Message Date
Tienson Qin
a7e9d073cd chore: rename :property/* to :logseq.property/* 2025-01-15 14:59:08 +08:00
Tienson Qin
9b751126d2 wip: replace :block/schema with corresponding properties 2025-01-06 11:41:38 +08:00
Tienson Qin
9e10dc1737 wip: use :block/tags to represent block types 2024-12-17 22:04:27 +08:00
Tienson Qin
1a98dcad91 fix: tests 2024-12-15 16:32:19 +08:00
Tienson Qin
09e93eee29 fix: full-text search can't include page reference 2024-12-15 15:16:15 +08:00
Gabriel Horner
f5666fab47 fix: deadline query doesn't work for db graphs
Fixes LOG-3245
2024-12-06 22:09:28 -05:00
Gabriel Horner
ce18010b2b refactor: Decouple simple queries in db graph
from original *property rules by giving simple queries
their own rules. This allows simple queries to grow in functionality
and complexity without affecting other features. Also fixed
private-property rule wasn't working because deps weren't configured
2024-11-21 17:56:58 -05:00
Gabriel Horner
1a7a2b25ed chore: add a couple assertions for between queries
from #11565. Also stop logging errors for valid between queries and
deleted unused test code
2024-11-11 16:32:35 -05:00
Gabriel Horner
0d3cf6c535 fix: db graph queries shouldn't run file graph filters
Throwing errors on unsupported filters for these makes it seem like we
support it when we don't. Better to be explicit. Also tweak
related tests so that file graph filters only run for file graphs
2024-11-08 14:32:07 -05:00
Gabriel Horner
cc2d6df37b fix: query builder can query private built-in properties
like before
2024-11-07 11:40:03 -05:00
Tienson Qin
11955e1443 fix: mixing datalog clauses with dsl query 2024-11-04 13:23:10 +08:00
Tienson Qin
3562b9e756 fix: between -1d should be compared to t/now instead of t/today 2024-11-01 22:14:09 +08:00
Tienson Qin
144e415cf9 fix: tags query 2024-10-31 21:07:16 +08:00
Tienson Qin
b3f1a0b43c fix: dsl datalog clause support 2-tuple 2024-10-14 05:50:05 +08:00
Tienson Qin
7cd208a51c feat: mix query dsl and datalog clauses 2024-10-14 05:44:07 +08:00
Tienson Qin
38c48259df fix: resolve between property 2024-10-10 17:53:45 +08:00
Tienson Qin
35c3dba160 enhance: between support (between :created-at -1d)
So now `between` support:
1. (between start end) to query journal blocks
2. (between :created-at|:updated-at start end)
3. (between :created-at|:updated-at start)
2024-10-10 16:55:58 +08:00
Tienson Qin
bb08621fea enhance: support tags in query dsl 2024-10-09 21:17:49 +08:00
Gabriel Horner
15fa327aec fix: block attrs for db advanced queries
db graph advanced queries were fetching file graph attributes
2024-09-30 12:39:33 -04:00
Gabriel Horner
d4b7720573 fix: remove last {{query reference seen in db graphs
Also fix return val of previous commit
2024-09-25 14:24:02 -04:00
Tienson Qin
263a2bf219 feat: add #Cards and :logseq.property/query
Some enhancements:
1. DSL query is a property value (:default type) for better UX.
2. Cards can be selected on the flashcards dialog.
2024-09-24 18:19:05 +08:00
Gabriel Horner
be54ab98e6 fix: property simple queries by name
Maintains backwards compatibility for property filter queries
which fixes imported and handwritten property queries. Extended
sqlite.build and test-helper capabilities in order to test this.
Fixes LOG-3231
2024-09-17 14:39:30 -04:00
Gabriel Horner
16402e45c4 fix: remove buggy and inconsistent sort-by filter
In #11508 db graphs moved to a new table which improved but
changed how sort worked for queries. Better to deprecate
the text sort-by filter than to have a buggy and inconsistent sort
for queries
2024-09-12 16:57:35 -04:00
Gabriel Horner
70383cd813 fix: stop shadowing vars for rest of frontend
Follow up to 5ff364ba1e
2024-09-07 00:13:09 -04:00
Gabriel Horner
5ff364ba1e fix: stop shadowing vars for components
Turn on kondo :shadowed-var lint and fix failures.  If this lint had
been turned on, it would have caught logseq/db-test#38 and saved us time
from debugging which random component was accidentally shadowed by a var
and failing with 'Objects are not valid as a React child'. Also fixed a
few outside components but stopped b/c there are too many to do right
now
2024-08-23 15:19:33 -04:00
Gabriel Horner
0769583183 fix: more missed renames of :page to :node type
from #11433
2024-08-02 10:34:35 -04:00
Tienson Qin
a1f352773b refactor: rename :block/original-name to :block/title 2024-07-10 21:43:03 +08:00
Tienson Qin
fec74edc0c Revert "fix: don't set :logseq.property/built-in? for properties"
This reverts commit e5bb634a08.
2024-06-27 16:27:41 +08:00
Tienson Qin
e5bb634a08 fix: don't set :logseq.property/built-in? for properties
We still keep :logseq.property/built-in? for built-in classes, pages
and closed values.

Reasons why this change:
1. built-in? value is a entity (which type is `checkbox` and value is
`true`), this breaks the rule that db attributes shouldn't reference
non-db-attribute blocks, it also forces us to load the built-in? value
entity first when loading the db.
2. we already have a built-in properties map, we can use it to check
whether a property is built-in.
2024-06-27 15:10:33 +08: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
7f3e22c8eb fix: priority filters for db graphs 2024-06-07 17:58:49 -04:00
Gabriel Horner
039da828ac enhance: infer property schema and add new-pages from properties
for sqlite-build graphs. Also fixed numbered page query not working for
db graphs and related tests
2024-06-07 12:10:15 -04:00
Gabriel Horner
3d9c606899 fix: query function for db graphs 2024-06-06 10:57:34 -04:00
Gabriel Horner
7e6f5878d6 fix: not filter query bug
for db graphs. not filter was returning all blocks
including all built-in properties. Also fixed a couple
tests to be db-graph compatible
2024-06-06 10:57:34 -04:00
Gabriel Horner
8f6f52d630 fix: sort-by filter for db graphs
Also fixed a dsl-query sorting bug where nil property values where
incorrectly being treated as greater than non-nil values. Also
fixed a bug where blocks with an explicit :block/created-at weren't
being set for sqlite-build
2024-06-05 16:57:51 -04:00
Gabriel Horner
e7f795103d fix: simple task queries and start fixing db dsl-query tests
Tests caught that task query wasn't working. Also disabled
namaspace test and rule for db graphs since they aren't supported
there
2024-06-04 15:53:36 -04:00
Gabriel Horner
ec7839fcce fix: simple queries in db graphs for most property types
Also fix parse-query was being called in multiple places
without a correct default value for :db-graph? option
2024-05-30 15:54:20 -04:00
Gabriel Horner
be9237d101 refactor: move rules deps usage into helper fn
Dries up task dependency that was copied in query-dsl
2024-05-07 22:11:27 -04:00
Gabriel Horner
4c3fc530b9 fix: task rule and filter for db graphs
Part of LOG-3042
2024-05-06 16:55:45 -04:00
Gabriel Horner
15825bd2ea fix: page-property queries for closed values
Also update properties graph to demo all the page property equivalents
to block property examples
2024-03-09 00:16:54 -05:00
Gabriel Horner
79fccaa659 fix: two bugs caused by not getting correct
closed value names for page/date closed values - one in
query builder property value dropdown and the other in show block data command.
Also cleaned up query-dsl which shouldn't be making db graph queries
on file graphs
2024-03-08 15:40:27 -05:00
Gabriel Horner
19c268c0c3 fix: floats not working in property queries
for db graphs. Also make dev log less noisey
2024-03-08 11:18:06 -05:00
Gabriel Horner
62e6084b45 fix: page/date closed values for *property queries
Also updated example graph to show closed value queries working
2024-03-08 10:17:22 -05:00
Gabriel Horner
a61e0d8e0e fix: query logging console error if no matching closed value
e.g. (property :status "tod"). Part of LOG-3088
2024-03-07 13:03:22 -05:00
Tienson Qin
4ea0dd257d fix: update property filters to work with task status
fixes LOG-3088
2024-03-07 17:58:32 +08:00
Tienson Qin
f26c002c3e fix: closed value query in dsl 2024-02-28 18:13:11 +08:00
Gabriel Horner
26bc6f0d1d chore: mv logseq.graph-parser.util.db to db dep
This ns is more appropriate in db and was only in graph-parser because
the date-time-util lib wasn't accessible to db until #10933 landed.
graph-parser dep is specific to file graphs and as much as possible
anything unrelated to this should not be in this dep
2024-02-09 16:16:33 -05:00
Tienson Qin
9194a671fd Move outliner core to its own dep 2024-01-03 18:02:48 +08:00
Tienson Qin
b7d9098e80 Move gp-util and gp-config to the common dep 2024-01-03 16:38:05 +08:00
Tienson Qin
018e1ae8ee Merge branch 'master' into feat/db 2023-12-23 14:18:25 +08:00