Where I can know the detail schema of logseq db

A new to logseq but I did have a programming background.
I check the documentation here to talk about advanced logseq query, https://logseq.github.io/#/page/advanced%20queries

It tells we can find the logseq db schema here:

While also show some example query like this one:

#+BEGIN_QUERY
{:title "All todos with tag project"
 :query [:find (pull ?b [*])
       :where
       [?p :block/name "project"]
       [?b :block/ref-pages ?p]]}
#+END_QUERY

However, I cannot even find the keyword “block/ref-pages” in the db_schema.cljs

I assume the block record in db should has a record with “block/ref-pages” in it, then the schema file should contains something like “block/ref-pages” at least, so did I miss something?

Hey, any comments? I am surprising it seems no one really care about this question, then how people create the magic query without a “schema” to refer?

@winterTTr here it schema logseq/db_schema.cljs at master · logseq/logseq (github.com)

has been replaced with :block/path-refs logseq/db_schema.cljs at master · logseq/logseq (github.com)

1 Like

Thanks very much, @danzu
So, how can I understand about how those schema really implemented internally?

Maybe I can ask a detail example, such as, assume I have a page named “Foo”, so how can I know what exactly “property” from that schema file which related to this “Foo” page.

For example, assume “block/ref-pages” may used as a data binding to this “Foo” block, so how can I know this fact only from that db_schema file except “guess”.

Is there some kind of “magic query” which people can used to understand a full entity + properties. I am trying to build some query, but I have no idea how to get a full property view of internal logseq entity.

Any suggestion would be greatly appreciated.

1 Like

Thx I came here because I have the same question. Maybe, you could update the query examples on your documentation page wherein still says „ref-pages“, see here:

https://logseq.github.io/#/page/advanced%20queries

1 Like

@winterTTr I agree that queries and how they can be used are a really underdocumented feature of Logseq which makes it hard to unlock their power.

Have you tried the developer mode (Settings > Advanced > Developer Mode)? It allows you to view page properties (Three dots in the corner > Show page data) and block properties (right click on bullet > show block data).

2 Likes

I have this question as well. (Links above are dead.)

If there’s no prepared/generated documentation on this, at least some accessible source code file/files that give hints would be great.

1 Like