Closed
Description
i want to create user-defined aggregate functions when using my sqlite database. sqlite expects aggregate functions to be defined with the same api as typical user-defined functions, plus additional aggregation parameters.
node:sqlite
provides access to the sqlite function definition api with a wrapper for sqlite3_create_function_v2
as the instance method DatabaseSync.function
but, this wrapper always passes null
for the aggregation parameter refs.
Lines 669 to 677 in 3b5f235
implementation suggestions
- a separate wrapper function, possibly called
aggregate
orreduce
, for user-defined functions that use these additional callback parameters - optional parameters for
function
that accept the callbacks, in the same order as the sqlite api - additional attributes on the
function
options parameter object