Some dashboard-like extensions and 'overviews' for org roam

I think it would be doable to map to SQL, somewhat similar to this package:

This package only works with org-roam-v2, but should be mappable to v2. I think it’s doable because we basically just need to write some “where” queries.

However, the only way to make this work sensibly would be to restrict which kinds of queries can be made using the syntax and not just allow ALL sql (although we could allow users to just write sql if they want, but that should be implementation dependent). I am thinking of “allowing” the following keywords:

  • file
  • title
  • id
  • level
  • tag
  • todo state
  • directory (same as file, but useful to have it for clarity)
  • ctime (debatable as it’s not logged directly)
  • mtime
  • other properties (debatable, as this is not easily accessed using emacsql)
  • is linked to from (backlinks basically)
  • links to (forward links)
  • connection (forward/backlink agnostic, should be default)
  • cites

Additionally, I would like “bare” words in the query to be used to make ripgrep searches for those words. I think that is very useful, and ripgrep is so fast that I don’t think we should be worried about performance.

I would use the following modifiers

  • and
  • or
  • not

For keywords that have a numeric value (creation date, number of links etc) we should have a few modifiers, namely

  • <
  • <=
  • >
  • =>
  • =

Should be doable to create such a syntax, we just need a way to map the appropriate keywords/modifiers to SQL WHERE queries, most of which are not very difficult (for filenames, just :where (like node:file "%<filequery>%"). Tags and cites are somewhat more complex, but not much, and for full-text search we don’t need to make queries obviously.

As for the actual syntax, I think copying org-ql’s syntax is a good idea, might even be able to integrate with it.

What do you think?