Module

x/pg_mem/transforms/aggregation.ts>Aggregation

An in memory postgres DB instance for your unit tests
Latest
class Aggregation
import { Aggregation } from "https://dotland.deno.dev/x/pg_mem@3.0.2/transforms/aggregation.ts";

Constructors

new
Aggregation(on: _ISelection, _groupedBy: Expr[])

Properties

private
readonly
aggId
private
aggregations: Map<string, AggregationInstance>
private
groupByMapping: Map<string, IValue>

How to get the grouped values on "this.enumerate()" raw items output

private
readonly
optional
groupIndex: _IIndex | nil
private
groupingValuesOnbase: IValue[]

How to get grouping values on the base table raw items (not on "this.enumerate()" raw items)

private
readonly
symbol: symbol

Group-by values

  • key: column in source hash
  • value: column in this, evaluated against temporary entity.
columns: readonly IValue[]

Methods

private
_enumerateAggregationKeys(t: _Transaction): Iterable<AggregItem>
private
_getAggregation(name: string, call: ExprCall): AggregationComputer
private
computeDirect(t: _Transaction): AggregItem | null
private
iterateFromIndex(t: _Transaction): AggregItem[] | null
private
seqScan(t: _Transaction): Iterable<AggregItem>
entropy(t: _Transaction): number
enumerate(t: _Transaction): Iterable<Row>
getAggregation(name: string, call: ExprCall): IValue
getColumn(column: string | ExprRef): IValue
getColumn(column: string | ExprRef, nullIfNotFound?: boolean): IValue | nil
getIndex(forValue: IValue): _IIndex | nil
hasItem(value: Row, t: _Transaction): boolean
stats(): Stats | null