You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
node:sqlite: DatabaseSync.function wrapper for sqlite3_create_function_v2 should allow use of xStep and xFinal parameters #56510
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.
i created this issue from the line highlight menu on node_sqlite.cc, so i didn't get the template prompt or label selection. sorry if this is out-of-order
sqlite api treats window aggregate functions as distinct from other types of aggregate functions. a wrapper that combines the metaphors must use the api conditionally.
your linked example also uses the v2 api on line 316
sqlite api treats window aggregate functions as distinct from other types of aggregate functions. a wrapper that combines the metaphors must use the api conditionally.
your linked example also uses the v2 api on line 316
I see.
The linked example is for aggregate function specifically.
From other issues, I can see that node:sqlite tries to be compatible with better-sqlite3. So, I think that, from this comment, using the sqlite3_create_window_function would be suitable.
Activity
turbocrime commentedon Jan 7, 2025
i created this issue from the line highlight menu on node_sqlite.cc, so i didn't get the template prompt or label selection. sorry if this is out-of-order
cjihrig commentedon Jan 7, 2025
That is the plan - similar to how it is done in better-sqlite3.
turbocrime commentedon Jan 7, 2025
is there a place for collected discussion and public work on this builtin?
cjihrig commentedon Jan 7, 2025
Not that I am aware of.
geeksilva97 commentedon Jan 13, 2025
better-sqlite3 uses
sqlite3_create_window_functionthough.I think implementing
aggregatelike this would end up solving #56511 as well.turbocrime commentedon Jan 13, 2025
sqlite api treats window aggregate functions as distinct from other types of aggregate functions. a wrapper that combines the metaphors must use the api conditionally.
your linked example also uses the v2 api on line 316
geeksilva97 commentedon Jan 13, 2025
I see.
The linked example is for aggregate function specifically.
From other issues, I can see that
node:sqlitetries to be compatible with better-sqlite3. So, I think that, from this comment, using thesqlite3_create_window_functionwould be suitable.cjihrig commentedon Apr 9, 2025
Fixed by #56600