Commit Graph

122 Commits

Author SHA1 Message Date
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
ksqsf
bfe7f5e826 fix: lint 2023-12-04 13:46:04 -05:00
ksqsf
ef60c92e30 fix: and-or query 2023-12-04 13:46:04 -05:00
Gabriel Horner
edaf9b286a chore: move frontend db namespaces to a dedicated parent ns
Moved these namespaces to logseq.db.frontend.* to make their purpose
explicit and make the namespaces easier to maintain
2023-10-16 17:24:51 -04:00
Gabriel Horner
991c0994e5 All query-dsl tests pass for db graphs
Add to CI. Also fix graph-parser lint and typo
2023-08-01 16:34:48 -04:00
Gabriel Horner
81ae67cdbe Add timestamp support to sort-by for db graphs 2023-07-31 16:34:33 -04:00
Gabriel Horner
8e360405d6 Fix sort-by for user properties with db graphs
sort-by-queries test passes except for timestamps.
Had to introduce another query to resolve property uuids.
Made it as efficient as possible with datoms and pull.
Refactored load-test-files to support journal files and
allow page and block properties from one file
2023-07-31 16:07:23 -04:00
Gabriel Horner
3f52860cf1 Fix perf issue with property rules for db graphs
Use multiple clauses instead as confirmed by perf test.
Using multiple clauses made rule preparation for d/q more complex
so introduced extract-rules
2023-07-25 17:20:17 -04:00
Gabriel Horner
e9fecfa280 Fix property rules for advanced queries with db graphs
and provide a rules var just for db graphs.
Also simplify query-dsl db-graph support as query-dsl/parse-query
doesn't need to know about db graphs for how it's used
2023-07-25 13:53:18 -04:00
rcmerci
0c4e9bf4d4 split db-version query rules 2023-06-27 19:28:12 +08:00
Tienson Qin
86c5376eb8 fix: disable reactive query in api/q 2023-04-12 23:57:05 +08:00
Tienson Qin
db6fc6b7ee feat: simple query builder (#8774)
Simple query builder

---------

Co-authored-by: Gabriel Horner <gabriel@logseq.com>
Co-authored-by: charlie <xyhp915@qq.com>
2023-03-21 14:27:00 +08:00
Gabriel Horner
17f51c7b77 Make resolve-input nbb compatible
- Brought back Xd-{before,after}-ms and tested it
- Move it to its own ns in graph-parser
- Updated nbb-logseq in deps/
- Made db-utils alias consistent
- Organized resolve-input
2023-01-07 02:49:07 -05:00
Gabriel Horner
9d9e976b8c Merge branch 'master' into refactor/refs-from-property-values 2022-09-21 15:34:47 -04:00
Gabriel Horner
60067cb817 Disable sorting if query contains and there is no default sorting
- Also fixed caret not showing up when sorting occurs by default for
  a default sorting state coming from :query-sort-by and
  :query-sort-desc
- Also cleaned up sort state. Rum local state doesn't seem necessary
2022-09-20 12:20:17 -04:00
Gabriel Horner
91d6d14720 Fix sort-by not working for blocks
- Also add sort-by support for pages which fixes #5643
- Add sort-by tests
- Fix sample producing weird queries e.g. mixed block and page clauses
- Clean up last, hard to read test setup in query-dsl
2022-09-20 12:20:17 -04:00
Tienson Qin
040fd5510f fix: some tests on graph_parser 2022-09-09 12:39:26 +08:00
Tienson Qin
f29ff96778 fix: CI errors 2022-09-09 12:37:57 +08:00
Tienson Qin
d1d1dc50c2 wip: get references from property values 2022-09-09 12:36:54 +08:00
Gabriel Horner
39b43b363c Fix page-properties bug and dsl-query bug
parser test caught page properties bug and dsl-query tests once written
correctly exposed another bug. Also remove unit test as they are
replaced by integration style tests in graph-parser-test
2022-08-11 16:32:00 -04:00
Gabriel Horner
0719163d30 Split out parse-property for use in dsl-query and tests
- Add tests for all *property dsl queries with and without new
  config option
- Add tests for property persistence
- Add tests for property relationships
2022-08-11 16:32:00 -04:00
Gabriel Horner
e0b1f6b2de Move common uses of page-ref to its own ns
By having a specific ns for page-ref utils, our code is more readable
and intention revealing. Also found that
text/{get-page-name,page-ref-un-brackets!} was getting called in
contexts that didn't make sense e.g. query layer was checking for
markdown and org page-refs
2022-08-04 17:25:29 +08:00
Tienson Qin
a1ca6820df Fix: broken linked references (#6105)
* enhance: clicking the refresh button if a query is slow

* fix: skip running slow queries if there's no need to refresh

* fix: linked reference filtering does not work on TASK items

close #1669

* fix: each block should have its own page as a reference when query page references

* fix: references

* fix: non consecutive blocks in query result and filtered linked references

* simplify filters logic

* fix: ref numbers

* Save both :block/refs and :block/path-refs for different usage

* fix: block refs

* enhance: move scheduled and deadlines to its own ns

* linked references performance tweaks

* mouse hover filters icon to expand the collapsed linked refs

* perf: react/refresh! once instead twice

* enhance: compute flashcards every hour instead of every 5s

* feat: macros as blocks

* feat: flashcards list

* fix: refed pages count

* fix: can't select in linked references

* fix: block editing on linked refs

* perf: editing in linked references

* enhance: update srs cards number when clicking flashcards

* Add a test for the case fixed in #6100

* Address feedbacks from Gabriel

* fix: Block Ref Indicator is missing from the references-blocks class

close #5375

* fix: referenced pages

* fix: page refs

* fix: Using filters pushed the title property to the second block

close #5845

Co-authored-by: Gabriel Horner <gabriel@logseq.com>
2022-08-04 13:03:12 +08:00
Peng Xiao
d271b85a51 fix: should only log query when debug is enabled 2022-07-20 11:55:17 +08:00
Gabriel Horner
17d2462343 Move rules into db dep as it's useful for external apps
- rules is already used by logseq-query and will be useful for
  nbb-logseq
- Updated db jobs to run in deps/db by default. Less typing but
  more importantly discourages independent libraries from depending on
  external scripts.
- Moved lint-rules task into db since it is db specific now
- Also remove nbb-logseq from top-level as all nbb compatibility is in
  deps.
2022-06-10 15:39:11 +08:00
Gabriel Horner
15b8e5e9df Setup CI jobs that are only for graph-parser
Also move all non graph-parser fns to frontend thanks to carve lint
2022-05-26 18:04:45 -04:00
Gabriel Horner
fec0b755a8 Upgrade cljs + shadow
- Upgraded shadow to keep goog compiler versions the same
- Converted some safe-parse-int's to parse-long
- Converted some safe-parse-float's to parse-double
- Simplified impl of safe-parse-* fns
2022-05-19 14:58:33 +08:00
Tienson Qin
7f256b8872 fix: sample query 2022-05-16 15:35:43 +08:00
Gabriel Horner
5b0d5fb8b5 Decouple graph-parser util from app util usage
For tiny util heavily used fns like safe-re-find and uuid-string?,
decouple graph-parser from so much of the app
2022-05-13 16:17:44 -04:00
Gabriel Horner
65804b4183 Split out text ns to graph-parser 2022-05-10 20:22:48 -04:00
Gabriel Horner
85bd1fecb2 Move first batch of util fns to graph-parser.util
Still need to fix external.roam
2022-05-04 12:02:36 -04:00
Gabriel Horner
6b935a8d58 Fix page-ref rule which was not bindable and failed fast
- page-ref had a :block/name embedded lookup ref which failed fast.
  datomic advises against this -
  https://docs.datomic.com/on-prem/schema/identity.html#:~:text=You%20cannot%20use%20them%20in%20the%20body%20of%20a%20query%2C%20use%20datalog%20clauses%20instead
- page-ref can handle binding args like last commit for page
- page-ref not failing fast on non-existing pages means that user can get meaningful results
  in more complex queries as seen in test
- Also remove try/catch as there should be no more queries that
  unintentionally cause the 'Nothing found for entity' error
- Also fixed lookup ref in srs cards which can be seen in stacktrace of
  #4576
2022-03-17 16:15:04 +08:00
Gabriel Horner
96da98e5bd Fix Tienson's nested not case 2022-03-16 16:04:59 +08:00
Gabriel Horner
a41dd0abfc Remove parse catch for consistent error handling
For advanced queries we error when invalid queries are written. We
should do the same for simple query.
Also add a test for tag query format
2022-03-16 16:04:59 +08:00
Gabriel Horner
e615423e6a Fix full text search without quotes not working
Decoupled query-dsl from search/block-search. This coupling added
unnecessary complexity as srs, custom queries and the api all depend
on query-dsl and don't need to be coupled to search/block-search
2022-03-16 16:04:59 +08:00
Gabriel Horner
8468602881 query-dsl + tests cleanup
Remove old string checks that no longer apply. Also added another blank
string case that causes an issue
2022-03-16 16:04:59 +08:00
Gabriel Horner
5f0efcf2d8 Fix another nested boolean case
Also removed or nested complexity from
903a757ce2 that no longer seems necessary
2022-03-16 16:04:59 +08:00
Gabriel Horner
3a19687988 Fix nested boolean case - close #4510 2022-03-16 16:04:59 +08:00