Bun

interface

sqlite.AggregateOptions

interface AggregateOptions<T extends SQLInputValue = SQLInputValue>

  • deterministic?: boolean
  • directOnly?: boolean
  • inverse?: (accumulator: T, ...args: SQLOutputValue[]) => T

    When this function is provided, the aggregate method will work as a window function. The function receives the current state and the dropped row value. The return value of this function should be the new state.

  • result?: (accumulator: T) => SQLInputValue

    The function to call to get the result of the aggregation. The function receives the final state and should return the result of the aggregation.

  • start: T | () => T

    The identity value for the aggregation function. This value is used when the aggregation function is initialized. When a Function is passed the identity will be its return value.

  • step: (accumulator: T, ...args: SQLOutputValue[]) => T

    The function to call for each row in the aggregation. The function receives the current state and the row value. The return value of this function should be the new state.

  • useBigIntArguments?: boolean

    If true, integer arguments to function are converted to BigInts. If false, integer arguments are passed as JavaScript numbers.

  • varargs?: boolean

    If true, function may be invoked with any number of arguments (between zero and SQLITE_MAX_FUNCTION_ARG). If false, function must be invoked with exactly function.length arguments.