Closed sgwilym closed 3 years ago
⭐ 💫
seems like participatingAuthor isn't used in the most recently published release?
It's there for memory but not sqlite yet.
query | memory | sqlite |
---|---|---|
versionsByAuthor | implemented | implemented |
participatingAuthor | implemented | not yet |
lastAuthor | not yet | not yet |
P.S. you likely already saw this, but types.ts has the documentation about the different query options.
@cinnamon-bun I was referring to it a lot! But now that I have you here... I read it again and again but I wasn't able to understand what the difference between versionsByAuthor
and participatingAuthor
is. Could you help me out? 😅
@sgwilym it's confusing. I don't know which kinds of queries we really need. Maybe I should remove some of these.
Example Data
most recent document versions are towards the right side
/path1: {author @a, content "1a"} {author @y, content "1y"}
/path2: {author @x, content "2x"} {author @a, content "2a"}
/path3: {author: @z, content "3z"}
Queries
The latest doc, by anyone, for any path that @a
has touched
{participatingAuthor: @a, includeHistory: false} --> 1y, 2a
All doc versions, by anyone, for any path that @a
has touched
{participatingAuthor: @a, includeHistory: true} --> 1a, 1y, 2x, 2a
Document versions by this author which are the latest in a path
{versionsByAuthor: @a, includeHistory: false} --> 2a
All document versions by this author including non-latest ones
{versionsByAuthor: @a, includeHistory: true} --> 1a, 2a
Paths where this author was the last writer; just the last doc
(Note this is the same as versionsByAuthor
when history is false)
{lastAuthor: @a, includeHistory: false} --> 2a
Paths where this author was the last writer; and all history at that path
{lastAuthor: @a, includeHistory: true} --> 2x, 2a
Ah, I had somehow missed this!
I kept thinking I was missing something because I kept reading versions and thinking "I thought only the latest version was kept...".
Thanks! I'm going to close this PR and merge in changes along with #11.
Adds filtering to document fields, so you can write queries like this:
Also supports the
versionsByAuthor
arg. Will be easy to add moreQueryOpts
from earthstar as they are implemented ( @cinnamon-bun seems likeparticipatingAuthor
isn't used in the most recently published release?)Best of all, this opens the door to partial syncing.
Closes #6