UNPKG

pg-mem

Version:

A memory version of postgres

41 lines 1.9 kB
import { TransformBase } from './transform-base'; import { _ISelection, _Transaction, IValue, _IIndex, _Explainer, _SelectExplanation, Stats, _IAggregation, Row } from '../interfaces-private'; import { Expr, ExprRef, ExprCall } from 'pgsql-ast-parser'; import { nil } from '../interfaces'; export declare const aggregationFunctions: Set<string>; export declare function buildGroupBy(on: _ISelection, groupBy: Expr[]): Aggregation; export declare function getAggregator(): _IAggregation | null; export declare class Aggregation extends TransformBase implements _ISelection, _IAggregation { columns: readonly IValue[]; /** * Group-by values * - key: column in source hash * - value: column in this, evaluated against temporary entity. **/ private readonly symbol; private readonly aggId; private readonly groupIndex?; private aggregations; /** How to get grouping values on the base table raw items (not on "this.enumerate()" raw items) */ private groupingValuesOnbase; /** How to get the grouped values on "this.enumerate()" raw items output */ private groupByMapping; isAggregation(): this is _IAggregation; constructor(on: _ISelection, _groupedBy: Expr[]); getColumn(column: string | ExprRef): IValue; getColumn(column: string | ExprRef, nullIfNotFound?: boolean): IValue | nil; checkIfIsKey(got: IValue): IValue; entropy(t: _Transaction): number; stats(): Stats | null; enumerate(t: _Transaction): Iterable<Row>; private _enumerateAggregationKeys; private iterateFromIndex; private seqScan; private computeDirect; getAggregation(name: string, call: ExprCall): IValue; private _getAggregation; hasItem(value: Row, t: _Transaction): boolean; getIndex(forValue: IValue): _IIndex | nil; explain(e: _Explainer): _SelectExplanation; } //# sourceMappingURL=aggregation.d.ts.map