Module

x/pg_mem/interfaces-private.ts>_ISelection

An in memory postgres DB instance for your unit tests
Go to Latest
interface _ISelection
implements _IAlias
import { type _ISelection } from "https://dotland.deno.dev/x/pg_mem@2.6.3/interfaces-private.ts";

Type Parameters

optional
T = any

Properties

readonly
optional
debugId: string
readonly
ownerSchema: _ISchema
readonly
db: _IDb
readonly
isExecutionWithNoResult: boolean

Tells if this statement is an execution without any meaningful result ("update" with no "returning", etc...)

readonly
columns: ReadonlyArray<IValue>

Column list (those visible when select *)

Methods

isAggregation(): this is _IAggregation

True when this is an aggregation being built

entropy(t: _Transaction): number

Statistical measure of how many items will be returned by this selection

enumerate(t: _Transaction): Iterable<T>
hasItem(value: T, t: _Transaction): boolean

Returns true if the given value is present in this

stats(t: _Transaction): Stats | null
getIndex(...forValue: IValue[]): _IIndex<T> | nil

Gets the index associated with this value (or returns null)

listSelectableIdentities(): Iterable<IValue>

All columns. A bit like .columns`, but including records selections

filter(where: Expr | nil): _ISelection
orderBy(orderBy: OrderByStatement[] | nil): _ISelection
groupBy(grouping: Expr[] | nil): _ISelection
distinct(select?: Expr[]): _ISelection
union(right: _ISelection): _ISelection
getColumn(column: string | ExprRef): IValue
getColumn(column: string | ExprRef, nullIfNotFound?: boolean): IValue | nil
setAlias(alias?: string): _ISelection
isOriginOf(a: IValue): boolean
select(select: (string | SelectedColumn)[]): _ISelection

Select a specific subset

selectAlias(alias: string): _IAlias | nil

Limit selection to a specific alias (in joins)