Add Search Queries #845
Replies: 5 comments 2 replies
-
Agree something like this is needed, so we should keep this issue, but definitely don't like how Roam queries are implemented.
|
Beta Was this translation helpful? Give feedback.
-
Designing a query language is a very very big job and I don't know how much developer time will be dedicated to query-language design. There are a lot of graph query languages out there, from very simple to complex. At the simple end is this blog post's proposed "TQL" which looks like It may be worth considering some meta-solutions:
|
Beta Was this translation helpful? Give feedback.
-
I'd propose just allowing people to issue Datascript queries against the database, and render the results nicely if they fit some format. For example, "if you issue a query that returns a single variable Pros
Cons
|
Beta Was this translation helpful? Give feedback.
-
Some meta-considerations: If we start with a very simple and restricted query language, there is no risk that the features will have to be taken away later (see @agentydragon's comment). If we then choose one day to modify the query language, we can provide a migration tool that parses all the blocks for query strings and replaces them with the new syntax. The thing I like about this idea is that we can get our hands dirty quickly without really foreclosing any future possibilities, do we? |
Beta Was this translation helpful? Give feedback.
-
I'd also say this would fit it in nicely to #2004. Basically you'd query just like you would with any other dynamic thing: {{dynamic
;; Athens query API
(athens/query
;; DataScript query
{:find ...
:where ...})
}} and a future {{dynamic
(athens/query
...)
}} |
Beta Was this translation helpful? Give feedback.
-
When a block contains the query string
{{[[query]]: {and: [[ex-A]] [[ex-B]]}}}
, all blocks containing the stringsex-A
andex-B
should be embedded below the query block.The article Searching Roam With Queries describes this in detail.
Beta Was this translation helpful? Give feedback.
All reactions