obsidian-dataview icon indicating copy to clipboard operation
obsidian-dataview copied to clipboard

Add missing DQL functions to Reference -> Functions, if there are any

Open AB1908 opened this issue 2 years ago • 4 comments

AB1908 avatar Oct 29 '22 18:10 AB1908

Goal of the issue: Compare if all functions implemented here: https://github.com/blacksmithgu/obsidian-dataview/blob/master/src/expression/functions.ts are available in the docs with all their variants

s-blu avatar Oct 29 '22 19:10 s-blu

Last I checked, 4 were missing mostly because I had no idea what they did. I wonder if we can do some sort of autogeneration from the test cases or the code itself. From my old list:

nonnull: (...args) => func(context, ...args)
minby: (...args) => func(context, ...args)
maxby: (...args) => func(context, ...args)

AB1908 avatar Oct 29 '22 20:10 AB1908

Last I checked, 4 were missing mostly because I had no idea what they did. I wonder if we can do some sort of autogeneration from the test cases or the code itself. From my old list:

nonnull: (...args) => func(context, ...args)
minby: (...args) => func(context, ...args)
maxby: (...args) => func(context, ...args)

These were documented by blacksmithgu lately, what's still missing is:

reduce: DefaultFunctions.reduce,
ldefault: DefaultFunctions.ldefault

and I did not check if there might be missing variants anywhere.

Edit: Checked the Variants, these seem to be missing:

  • length -> string
  • link
    • add3("string", "string", "boolean"
    • add2("link", "string"
  • contains, icontains, econtains
    • add2("", ""
  • reverse -> string
  • sort
    • add2("array", "function"

While checking the variants, I noticed that the only difference between (documented) fdefault and (undocumented) ldefault is that fdefault vectorized, ldefault is not? Maybe @blacksmithgu can shed light on why ldefault exists ... and if it should be documented at all.

s-blu avatar Nov 05 '22 21:11 s-blu

I'm working on a PR to complete this, so if that's approved then this is to be complete as of 0.5.64

holroy avatar Feb 03 '24 15:02 holroy