logseq / docs

Logseq documentation
https://docs.logseq.com
MIT License
124 stars 90 forks source link

document dsl rules for advance queries #69

Open xxchan opened 1 year ago

xxchan commented 1 year ago

I was trying to understand what's the actual meaning of between, but I can't find the documentation. It seems to be the task's journal date, but these queries made me think it's the referenced journal date: (Tasks referencing due dates ...)

https://github.com/logseq/docs/blob/cdbec0f9025507994559e5fb8aa607eae08006e1/pages/Advanced%20Queries.md#L177-L204

Then I found the definition here https://github.com/logseq/logseq/blob/master/deps/db/src/logseq/db/rules.cljc

   :between
   '[(between ?b ?start ?end)
     [?b :block/page ?p]
     [?p :block/journal? true]
     [?p :block/journal-day ?d]
     [(>= ?d ?start)]
     [(<= ?d ?end)]]

So it's indeed the task's journal date and the queries above are wrongly explained. I think it might be better to add documentation for these rules, and fixup the examples.

Bad3r commented 1 year ago

Thank you @xxchan!
Since you did a lot of the hard work so far, do you want to submit a PR with the changes?

cnrpman commented 1 year ago

More items to document for advanced queries:

  1. https://github.com/logseq/docs/issues/60

  2. Some great examples can be found here to help the documenting: https://discuss.logseq.com/t/queries-for-task-management/14937/51

  3. Also need to document how to setup default-queries in config.edn And how to capture ddls https://github.com/logseq/logseq/issues/9569#issuecomment-1574831602

YeungOnion commented 9 months ago

I thought this was a minor thing that was just me and didn't even check the issues - I suppose I should have - @xxchan looks like they have better homework than I had. I opened a very basic PR #114 since I thought it if was wrong it would attract attention and since I don't know any clojure, I'm sure I have misunderstanding.