Module

x/pg_mem/transforms/aggregation.ts>Aggregation

An in memory postgres DB instance for your unit tests
Go to Latest
class Aggregation
extends TransformBase<T>
import { Aggregation } from "https://dotland.deno.dev/x/pg_mem@2.6.3/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<any> | 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<any>[]

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>
checkIfIsKey(got: IValue<any>): IValue<any>
entropy(t: _Transaction): number
enumerate(t: _Transaction): Iterable<T>
getAggregation(name: string, call: ExprCall): IValue
getColumn(column: string | ExprRef): IValue
getColumn(column: string | ExprRef, nullIfNotFound?: boolean): IValue | nil
getIndex(forValue: IValue<any>): _IIndex<any> | nil
hasItem(value: T, t: _Transaction): boolean
stats(): Stats | null