deno.land / x / pg_mem@2.8.1 / schema / function-call-table.ts

function-call-table.ts
نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import { _Transaction, IValue, _Explainer, _IIndex, _SelectExplanation, Stats } from '../interfaces-private.ts';import { RecordCol } from '../datatypes/index.ts';import { buildCtx } from '../parser/context.ts';import { DataSourceBase } from '../transforms/transform-base.ts';import { columnEvaluator } from '../transforms/selection.ts';import { colByName, fromEntries } from '../utils.ts';
export class FunctionCallTable extends DataSourceBase<any> { readonly columns: readonly IValue<any>[]; private readonly colsByName: Map<string, IValue<any>>; private symbol = Symbol();
get isExecutionWithNoResult(): boolean { return false; }
constructor(cols: readonly RecordCol[], private evaluator: IValue) { super(buildCtx().schema); this.columns = cols.map(c => columnEvaluator(this, c.name, c.type).setOrigin(this)); this.colsByName = fromEntries(this.columns.map(c => [c.id!, c])); }
entropy(t: _Transaction): number { return 0; }
enumerate(t: _Transaction): Iterable<any> { const results = this.evaluator.get(null, t); for (const result of results ?? []) { result[this.symbol] = true; } return results; }
hasItem(value: any, t: _Transaction): boolean { return !!(value as any)[this.symbol]; }
getColumn(column: string, nullIfNotFound?: boolean | undefined): IValue<any> { return colByName(this.colsByName, column, nullIfNotFound)!; }
getIndex(forValue: IValue<any>): _IIndex<any> | null | undefined { return null; }
isOriginOf(value: IValue<any>): boolean { return value.origin === this; }

explain(e: _Explainer): _SelectExplanation { throw new Error('Method not implemented.'); }
stats(t: _Transaction): Stats | null { throw new Error('Method not implemented.'); }}
pg_mem

Version Info

Tagged at
4 months ago