Skip to content

Database.aggregate() method

Home > @direct-sqlite/core > Database > aggregate

Hooks up custom metric calculations that aggregate state step-by-step across matching rows.

Signature:

aggregate(name: string, options: {
start: any;
step: (acc: any, next: any) => any;
result?: (acc: any) => any;
}): this;

Parameter

Type

Description

name

string

The name of the aggregate function to register.

options

{ start: any; step: (acc: any, next: any) => any; result?: (acc: any) => any; }

Aggregate function options to register.

Returns:

this