Trying to learn Dataview query syntax

I’ve been a developer for 30 years. I’ve used SQL most of that time. When I first discovered Dataview, I was excited because I thought I could use my knowledge of SQL to create elaborate reports. But I quickly learned that knowledge of SQL probably hurts me here. Aside from sharing a few keywords, SQL and Dataview have nothing in common. So I ignored all my SQL knowledge and took another look at it.

After understanding some basics, I learned some basic queries that improved the context I could give to my notes. I love that I can automatically see all related tasks in a note with a query built into the template. So awesome.

Here’s my problem. I’m a documentation reader. I love man pages. I read the instructions. I’ve read through a lot of the documentation for Dataview.

Before I continue, I must say that I’ve really been impressed with the documentation of Obsidian and almost all contrib plugins. I also love that the documentation is linked to in the plugin overview pages.

So while there is a lot of documentation for Dataview, I haven’t found the thing I need most, which is a language reference. There are tons of example queries out therer, but I have not found documentation that explains in full stuff like language keywords (WHERE, TASKS, GROUP BY, FROM, SORT, etc. These are all SQL keywords as well, but they mostly don’t mean the same thing in Dataview. So where can I find out all keywords and what they mean? Another big one is searchable fields. I know I can use properties of the file object. I can use file.frontmatter values as well. I recently learned that I can do a TASKS query, but I can’t find a way to search on the ‘completed on’ data value (provided by the tasks plugin).

I did find an example of what I’m talking about. Here’s a link to available file property values. This is the type of documentation I’m talking about.

How can I get this same level of clarity on the rest of available fields and the core language syntax.

Thanks

I don’t know, but if it’s missing from the documentation you could report that on the plugin’s GitHub.

Have you seen the Dataview documentation site at Dataview ?

There are both some overview pages, and specific reference pages on what you can do in either mode, and some references to a few other utilities to aid in documenting it.

If you want to utilize your SQL knowledge, maybe you should give Query All The Things a go as well:

But yeah, it sounds like might not have seen the actual Dataview documentation site.

For the language reference, this is probably the best starting point: Structure of a Query - Dataview

As for what you can query, see the Metadata pages: Adding Metadata - Dataview

And the source page: Sources - Dataview

BTW, the Dataview docs even feature a page comparing DQL to SQL: Differences to SQL - Dataview

1 Like

As a documentation reader myself, I was quite happy with:

The main difference to SQL is, that in DQL sequence matters. The commands are executed from top to bottom.

I’ve had looked at all the above items except #2. I just discovered that yesterday. I also missed the ‘Query Language’ section of the Dataviews documentation, which Is pretty much what I was looking for.

Thanks everyone.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.