zk-org / zk

A plain text note-taking assistant
https://zk-org.github.io/zk/
GNU General Public License v3.0
1.63k stars 118 forks source link

Unable to list by link and backlink #254

Closed mhanberg closed 1 year ago

mhanberg commented 1 year ago

Description

I am attempting to find all notes that are linked by or backlinked to a given note, but I am receiving the following error

┌─ 03:43:25 PM
│iCloud/notes/work
└─  zk list --link-to=azcb.md --linked-by=azcb.md
zk: error: ambiguous column name: l.snippet

Should this work?

mickael-menu commented 1 year ago

Thank you, it should be fixed in main.

mhanberg commented 1 year ago

Thanks, I appreciate it. I'll try again on monday.

mhanberg commented 1 year ago

Tried this out.

I expected this to be an "OR" operation, in that it would show me notes that are linking to the specified note, as well as notes that are linked by the specified note.

But it seems to be doing an "AND" operation, only returning notes that satisfy both conditions.

Is that expected?

mickael-menu commented 1 year ago

Yes that's expected, the CLI flags are additive (although I agree that for these two flags it might be less useful). You could add an alias like this to do two different queries:

anylink = "zk list -q --linked-by $@ && zk list -q --link-to $@"