MCPcopy Create free account
hub / github.com/WiseLibs/better-sqlite3 / CustomAggregate

Method CustomAggregate

src/util/custom-aggregate.cpp:4–19  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2public:
3
4 explicit CustomAggregate(
5 Napi::Env env,
6 Database* db,
7 const char* name,
8 Napi::Value start,
9 Napi::Function step,
10 Napi::Value inverse,
11 Napi::Value result,
12 bool safe_ints
13 ) :
14 CustomFunction(env, db, name, step, safe_ints),
15 invoke_result(result.IsFunction()),
16 invoke_start(start.IsFunction()),
17 inverse(inverse.IsFunction() ? Napi::Persistent(inverse.As<Napi::Function>()) : Napi::FunctionReference()),
18 result(result.IsFunction() ? Napi::Persistent(result.As<Napi::Function>()) : Napi::FunctionReference()),
19 start(Napi::Persistent(start)) {}
20
21 static void xStep(sqlite3_context* invocation, int argc, sqlite3_value** argv) {
22 xStepBase(invocation, argc, argv, &CustomAggregate::fn);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected