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.
| int r = sqlite3_create_function_v2(db->connection_, |
| *name, |
| argc, |
| text_rep, |
| user_data, |
| UserDefinedFunction::xFunc, |
| nullptr, |
| nullptr, |
| UserDefinedFunction::xDestroy); |
implementation suggestions
- a separate wrapper function, possibly called
aggregate or reduce, 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
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:sqliteprovides access to the sqlite function definition api with a wrapper forsqlite3_create_function_v2as the instance methodDatabaseSync.functionbut, this wrapper always passes
nullfor the aggregation parameter refs.node/src/node_sqlite.cc
Lines 669 to 677 in 3b5f235
implementation suggestions
aggregateorreduce, for user-defined functions that use these additional callback parametersfunctionthat accept the callbacks, in the same order as the sqlite apifunctionoptions parameter object