Module

x/pg_mem/transforms/transform-base.ts>FilterBase

An in memory postgres DB instance for your unit tests
Go to Latest
class FilterBase
extends TransformBase<T>
Abstract
import { FilterBase } from "https://dotland.deno.dev/x/pg_mem@2.6.3/transforms/transform-base.ts";

Constructors

new
FilterBase(_base: _ISelection<T>)

Properties

readonly
columns: ReadonlyArray<IValue<any>>

Methods

getColumn(column: string | ExprRef): IValue

private _columns: IValue[]; private _columnMappings: Map<IValue, IValue>; get columns(): ReadonlyArray<IValue> { this.initCols(); return this._columns; // return this.base.columns; }

private initCols() {
    if (this._columns) {
        return;
    }
    this._columns = [];
    this._columnMappings = new Map();
    for (const c of this.base.columns) {
        const nc = c.setOrigin(this);
        this._columns.push(nc);
        this._columnMappings.set(c, nc);
    }
}

getColumn(column: string, nullIfNotFound?: boolean): IValue<any> {
    if (!this.base) { // istanbul ignore next
        throw new Error('Should not call .getColumn() on join');
    }
    if (!('columns' in this.base)) { // istanbul ignore next
        throw new Error('Should not call getColumn() on table');
    }
    this.initCols();
    const col = this.base.getColumn(column, nullIfNotFound);
    return col && this._columnMappings.get(col);
}
getColumn(column: string | ExprRef, nullIfNotFound?: boolean): IValue | nil
getIndex(...forValue: IValue<any>[]): _IIndex<any> | null | undefined
isAggregation(): boolean
selectAlias(alias: string): nil | _IAlias