SIGN IN SIGN UP

Enable custom aggregate functions (take 2) (#529)

* initial commit.

* documentation

* remove no-longer-valid type

* close over state initialization for performance

* link documentation in comment

* more testing

* run tests if they're main

* accept a single arg

* this kind of works but I'm abandoning this branch

Basically it seems that the sqlite extension pattern of 'allocate
a struct and stick it in the context pointer' is not going to work
for us here. I wonder if using the id of the pointer returned by
sqlite3_aggregate_context would be enough? Since no two functions
could use the same pointer, per https://www.sqlite.org/c3ref/aggregate_context.html ?

* a middle road sqlite3_agg_context solution

* try out auto-updating state

* improve quantile test, add multiple agg test

* add a null to the test

* acorn fails to parse ||=, whatever

* make eslint happy

* make initial_value an argument

* test step and finalize exceptions

* add memory leak test

* update docs to current interface

* delete state in exception handlers

* remove null state

* return init function and document object

* more tests and update back to init function

* update redefinition test for new interface

* update README to match fixed signature

* more consistent test formatting

* Update README.md

Co-authored-by: Ophir LOJKINE <contact@ophir.dev>

* clarify what exactly the result will contain

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Improve documentation and type annotations

* ignore documentation in eslintrc

* reduce code size

Thanks a lot, @llimllib !
 
Co-authored-by: dogquery <>
Co-authored-by: Ophir LOJKINE <contact@ophir.dev>
B
Bill Mill committed
5e5b063bd38a6303adc25473bdbc02ce4e9863b9
Parent: 577056b
Committed by GitHub <noreply@github.com> on 9/8/2022, 12:46:35 AM