@depup/pg-mem 3.0.14-depup.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -0
- package/changes.json +26 -0
- package/index.d.ts +1 -0
- package/index.js +16547 -0
- package/index.js.map +1 -0
- package/package.json +196 -0
- package/readme.md +297 -0
- package/types/adapters/adapters.d.ts +37 -0
- package/types/adapters/index.d.ts +2 -0
- package/types/adapters/pg-socket-adapter.d.ts +30 -0
- package/types/column.d.ts +27 -0
- package/types/constraints/foreign-key.d.ts +14 -0
- package/types/constraints/generated-from-expr.d.ts +14 -0
- package/types/constraints/generated-identity.d.ts +13 -0
- package/types/constraints/index-cst.d.ts +9 -0
- package/types/constraints/subscription.d.ts +7 -0
- package/types/constraints/wrapped.d.ts +9 -0
- package/types/datatypes/datatype-base.d.ts +66 -0
- package/types/datatypes/datatypes-geometric.d.ts +59 -0
- package/types/datatypes/datatypes-geometric.spec.d.ts +2 -0
- package/types/datatypes/datatypes.d.ts +101 -0
- package/types/datatypes/index.d.ts +2 -0
- package/types/datatypes/t-custom-enum.d.ts +21 -0
- package/types/datatypes/t-equivalent.d.ts +18 -0
- package/types/datatypes/t-inet.d.ts +13 -0
- package/types/datatypes/t-interval.d.ts +13 -0
- package/types/datatypes/t-jsonb.d.ts +16 -0
- package/types/datatypes/t-record.d.ts +17 -0
- package/types/datatypes/t-regclass.d.ts +11 -0
- package/types/datatypes/t-regtype.d.ts +11 -0
- package/types/datatypes/t-time.d.ts +14 -0
- package/types/datatypes/t-timestamp.d.ts +18 -0
- package/types/db.d.ts +3 -0
- package/types/evaluator.d.ts +61 -0
- package/types/execution/clean-results.d.ts +5 -0
- package/types/execution/exec-utils.d.ts +19 -0
- package/types/execution/records-mutations/deletion.d.ts +8 -0
- package/types/execution/records-mutations/insert.d.ts +13 -0
- package/types/execution/records-mutations/mutation-base.d.ts +31 -0
- package/types/execution/records-mutations/truncate-table.d.ts +10 -0
- package/types/execution/records-mutations/update.d.ts +10 -0
- package/types/execution/schema-amends/alter-enum.d.ts +20 -0
- package/types/execution/schema-amends/alter-sequence.d.ts +19 -0
- package/types/execution/schema-amends/alter.d.ts +19 -0
- package/types/execution/schema-amends/comment.d.ts +19 -0
- package/types/execution/schema-amends/create-enum.d.ts +20 -0
- package/types/execution/schema-amends/create-function.d.ts +20 -0
- package/types/execution/schema-amends/create-index.d.ts +19 -0
- package/types/execution/schema-amends/create-materialized-view.d.ts +19 -0
- package/types/execution/schema-amends/create-schema.d.ts +19 -0
- package/types/execution/schema-amends/create-sequence.d.ts +21 -0
- package/types/execution/schema-amends/create-table.d.ts +21 -0
- package/types/execution/schema-amends/create-view.d.ts +22 -0
- package/types/execution/schema-amends/do.d.ts +9 -0
- package/types/execution/schema-amends/drop-index.d.ts +18 -0
- package/types/execution/schema-amends/drop-sequence.d.ts +18 -0
- package/types/execution/schema-amends/drop-table.d.ts +19 -0
- package/types/execution/schema-amends/drop-type.d.ts +18 -0
- package/types/execution/select.d.ts +15 -0
- package/types/execution/set.d.ts +9 -0
- package/types/execution/show.d.ts +8 -0
- package/types/execution/statement-exec.d.ts +26 -0
- package/types/execution/transaction-statements.d.ts +16 -0
- package/types/functions/date.d.ts +3 -0
- package/types/functions/index.d.ts +2 -0
- package/types/functions/numbers.d.ts +3 -0
- package/types/functions/sequence-fns.d.ts +3 -0
- package/types/functions/string.d.ts +3 -0
- package/types/functions/subquery.d.ts +3 -0
- package/types/functions/system.d.ts +3 -0
- package/types/index.d.ts +5 -0
- package/types/interfaces-private.d.ts +605 -0
- package/types/interfaces.d.ts +449 -0
- package/types/migrate/migrate-interfaces.d.ts +32 -0
- package/types/migrate/migrate.d.ts +8 -0
- package/types/misc/buffer-deno.d.ts +7 -0
- package/types/misc/buffer-node.d.ts +7 -0
- package/types/misc/pg-escape.d.ts +2 -0
- package/types/misc/pg-utils.d.ts +3 -0
- package/types/parser/context.d.ts +26 -0
- package/types/parser/expression-builder.d.ts +8 -0
- package/types/parser/function-call.d.ts +4 -0
- package/types/parser/parse-cache.d.ts +6 -0
- package/types/schema/btree-index.d.ts +48 -0
- package/types/schema/consts.d.ts +10 -0
- package/types/schema/custom-index.d.ts +31 -0
- package/types/schema/function-call-table.d.ts +20 -0
- package/types/schema/information-schema/columns-list.d.ts +13 -0
- package/types/schema/information-schema/constraint-column-usage.d.ts +10 -0
- package/types/schema/information-schema/index.d.ts +3 -0
- package/types/schema/information-schema/key-column-usage.d.ts +10 -0
- package/types/schema/information-schema/table-constraints.d.ts +10 -0
- package/types/schema/information-schema/table-list.d.ts +14 -0
- package/types/schema/overload-resolver.d.ts +17 -0
- package/types/schema/pg-catalog/binary-operators.d.ts +3 -0
- package/types/schema/pg-catalog/index.d.ts +3 -0
- package/types/schema/pg-catalog/pg-attribute-list.d.ts +11 -0
- package/types/schema/pg-catalog/pg-class.d.ts +13 -0
- package/types/schema/pg-catalog/pg-constraints-list.d.ts +13 -0
- package/types/schema/pg-catalog/pg-database.d.ts +17 -0
- package/types/schema/pg-catalog/pg-enum-list.d.ts +10 -0
- package/types/schema/pg-catalog/pg-index-list.d.ts +10 -0
- package/types/schema/pg-catalog/pg-namespace-list.d.ts +10 -0
- package/types/schema/pg-catalog/pg-proc.d.ts +10 -0
- package/types/schema/pg-catalog/pg-range.d.ts +10 -0
- package/types/schema/pg-catalog/pg-sequences-list.d.ts +10 -0
- package/types/schema/pg-catalog/pg-type-list.d.ts +10 -0
- package/types/schema/pg-catalog/pg-user-list.d.ts +10 -0
- package/types/schema/pg-catalog/pg_statio_user_tables.d.ts +25 -0
- package/types/schema/pg-catalog/sql-function-language.d.ts +3 -0
- package/types/schema/prepared-intercepted.d.ts +11 -0
- package/types/schema/prepared.d.ts +5 -0
- package/types/schema/readonly-table.d.ts +62 -0
- package/types/schema/schema.d.ts +73 -0
- package/types/schema/sequence.d.ts +27 -0
- package/types/schema/table-index.d.ts +32 -0
- package/types/schema/values-table.d.ts +16 -0
- package/types/schema/view.d.ts +18 -0
- package/types/table.d.ts +97 -0
- package/types/transaction.d.ts +26 -0
- package/types/transforms/aggregation.d.ts +41 -0
- package/types/transforms/aggregations/array_agg.d.ts +11 -0
- package/types/transforms/aggregations/avg.d.ts +11 -0
- package/types/transforms/aggregations/bool-aggregs.d.ts +12 -0
- package/types/transforms/aggregations/count.d.ts +19 -0
- package/types/transforms/aggregations/json_aggs.d.ts +11 -0
- package/types/transforms/aggregations/max-min.d.ts +12 -0
- package/types/transforms/aggregations/sum.d.ts +11 -0
- package/types/transforms/alias.d.ts +29 -0
- package/types/transforms/and-filter.d.ts +15 -0
- package/types/transforms/array-filter.d.ts +14 -0
- package/types/transforms/between-filter.d.ts +16 -0
- package/types/transforms/build-filter.d.ts +4 -0
- package/types/transforms/distinct.d.ts +16 -0
- package/types/transforms/eq-filter.d.ts +17 -0
- package/types/transforms/false-filter.d.ts +11 -0
- package/types/transforms/in-filter.d.ts +14 -0
- package/types/transforms/ineq-filter.d.ts +16 -0
- package/types/transforms/join.d.ts +74 -0
- package/types/transforms/limit.d.ts +18 -0
- package/types/transforms/not-in-filter.d.ts +15 -0
- package/types/transforms/or-filter.d.ts +13 -0
- package/types/transforms/order-by.d.ts +26 -0
- package/types/transforms/restrictive-index.d.ts +15 -0
- package/types/transforms/selection.d.ts +45 -0
- package/types/transforms/seq-scan.d.ts +14 -0
- package/types/transforms/startswith-filter.d.ts +14 -0
- package/types/transforms/transform-base.d.ts +100 -0
- package/types/transforms/union.d.ts +32 -0
- package/types/utils.d.ts +86 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { _Transaction } from './interfaces-private';
|
|
2
|
+
import { Map as ImMap, Set as ImSet } from 'immutable';
|
|
3
|
+
export declare class Transaction implements _Transaction {
|
|
4
|
+
private parent;
|
|
5
|
+
private data;
|
|
6
|
+
private origData;
|
|
7
|
+
private transientData;
|
|
8
|
+
static root(): Transaction;
|
|
9
|
+
get isChild(): boolean;
|
|
10
|
+
private constructor();
|
|
11
|
+
clone(): Transaction;
|
|
12
|
+
fork(): _Transaction;
|
|
13
|
+
commit(): _Transaction;
|
|
14
|
+
fullCommit(): _Transaction;
|
|
15
|
+
rollback(): Transaction;
|
|
16
|
+
delete(identity: symbol): void;
|
|
17
|
+
set<T>(identity: symbol, data: T): T;
|
|
18
|
+
get<T>(identity: symbol): T;
|
|
19
|
+
getMap<T extends ImMap<any, any>>(identity: symbol): T;
|
|
20
|
+
getSet<T>(identity: symbol): ImSet<T>;
|
|
21
|
+
setTransient<T>(identity: symbol, data: T): T;
|
|
22
|
+
/** Set transient data, which will only exist within the scope of the current statement */
|
|
23
|
+
getTransient<T>(identity: symbol): T;
|
|
24
|
+
clearTransientData(): void;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=transaction.d.ts.map
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { TransformBase } from './transform-base';
|
|
2
|
+
import { _ISelection, _Transaction, IValue, _IIndex, _Explainer, _SelectExplanation, Stats, _IAggregation, Row } from '../interfaces-private';
|
|
3
|
+
import { Expr, ExprRef, ExprCall } from 'pgsql-ast-parser';
|
|
4
|
+
import { nil } from '../interfaces';
|
|
5
|
+
export declare const aggregationFunctions: Set<string>;
|
|
6
|
+
export declare function buildGroupBy(on: _ISelection, groupBy: Expr[]): Aggregation;
|
|
7
|
+
export declare function getAggregator(): _IAggregation | null;
|
|
8
|
+
export declare class Aggregation extends TransformBase implements _ISelection, _IAggregation {
|
|
9
|
+
columns: readonly IValue[];
|
|
10
|
+
/**
|
|
11
|
+
* Group-by values
|
|
12
|
+
* - key: column in source hash
|
|
13
|
+
* - value: column in this, evaluated against temporary entity.
|
|
14
|
+
**/
|
|
15
|
+
private readonly symbol;
|
|
16
|
+
private readonly aggId;
|
|
17
|
+
private readonly groupIndex?;
|
|
18
|
+
private aggregations;
|
|
19
|
+
/** How to get grouping values on the base table raw items (not on "this.enumerate()" raw items) */
|
|
20
|
+
private groupingValuesOnbase;
|
|
21
|
+
/** How to get the grouped values on "this.enumerate()" raw items output */
|
|
22
|
+
private groupByMapping;
|
|
23
|
+
isAggregation(): this is _IAggregation;
|
|
24
|
+
constructor(on: _ISelection, _groupedBy: Expr[]);
|
|
25
|
+
getColumn(column: string | ExprRef): IValue;
|
|
26
|
+
getColumn(column: string | ExprRef, nullIfNotFound?: boolean): IValue | nil;
|
|
27
|
+
checkIfIsKey(got: IValue): IValue;
|
|
28
|
+
entropy(t: _Transaction): number;
|
|
29
|
+
stats(): Stats | null;
|
|
30
|
+
enumerate(t: _Transaction): Iterable<Row>;
|
|
31
|
+
private _enumerateAggregationKeys;
|
|
32
|
+
private iterateFromIndex;
|
|
33
|
+
private seqScan;
|
|
34
|
+
private computeDirect;
|
|
35
|
+
getAggregation(name: string, call: ExprCall): IValue;
|
|
36
|
+
private _getAggregation;
|
|
37
|
+
hasItem(value: Row, t: _Transaction): boolean;
|
|
38
|
+
getIndex(forValue: IValue): _IIndex | nil;
|
|
39
|
+
explain(e: _Explainer): _SelectExplanation;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=aggregation.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AggregationComputer, AggregationGroupComputer, IValue, _ISelection, _IType, _Transaction } from '../../interfaces-private';
|
|
2
|
+
import { ExprCall } from 'pgsql-ast-parser';
|
|
3
|
+
declare class ArrayAggExpr implements AggregationComputer<any[]> {
|
|
4
|
+
private exp;
|
|
5
|
+
constructor(exp: IValue);
|
|
6
|
+
get type(): _IType<any>;
|
|
7
|
+
createGroup(t: _Transaction): AggregationGroupComputer<any[]>;
|
|
8
|
+
}
|
|
9
|
+
export declare function buildArrayAgg(this: void, base: _ISelection, call: ExprCall): ArrayAggExpr;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=array_agg.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AggregationComputer, AggregationGroupComputer, IValue, _ISelection, _IType, _Transaction } from '../../interfaces-private';
|
|
2
|
+
import { ExprCall } from 'pgsql-ast-parser';
|
|
3
|
+
declare class AvgExpr implements AggregationComputer<number> {
|
|
4
|
+
private exp;
|
|
5
|
+
constructor(exp: IValue);
|
|
6
|
+
get type(): _IType<any>;
|
|
7
|
+
createGroup(t: _Transaction): AggregationGroupComputer<number>;
|
|
8
|
+
}
|
|
9
|
+
export declare function buildAvg(this: void, base: _ISelection, call: ExprCall): AvgExpr;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=avg.d.ts.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { _ISelection, AggregationComputer, IValue, _IType, _Transaction, AggregationGroupComputer } from '../../interfaces-private';
|
|
2
|
+
import { ExprCall } from 'pgsql-ast-parser';
|
|
3
|
+
declare class BoolAgg implements AggregationComputer<boolean> {
|
|
4
|
+
private exp;
|
|
5
|
+
private isOr;
|
|
6
|
+
constructor(exp: IValue, isOr: boolean);
|
|
7
|
+
get type(): _IType<any>;
|
|
8
|
+
createGroup(t: _Transaction): AggregationGroupComputer<boolean>;
|
|
9
|
+
}
|
|
10
|
+
export declare function buildBoolAgg(this: void, base: _ISelection, call: ExprCall, fn: 'bool_and' | 'bool_or'): BoolAgg;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=bool-aggregs.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { AggregationComputer, AggregationGroupComputer, IndexKey, IValue, _IIndex, _ISelection, _IType, _Transaction } from '../../interfaces-private';
|
|
2
|
+
import { ExprCall } from 'pgsql-ast-parser';
|
|
3
|
+
export declare function buildCount(this: void, base: _ISelection, call: ExprCall): CountStar | CountExpr;
|
|
4
|
+
declare class CountStar implements AggregationComputer<number> {
|
|
5
|
+
private on;
|
|
6
|
+
constructor(on: _ISelection);
|
|
7
|
+
get type(): _IType<any>;
|
|
8
|
+
computeFromIndex(key: IndexKey, index: _IIndex, t: _Transaction): number | undefined;
|
|
9
|
+
computeNoGroup(t: _Transaction): number | undefined;
|
|
10
|
+
createGroup(): AggregationGroupComputer<number>;
|
|
11
|
+
}
|
|
12
|
+
declare class CountExpr implements AggregationComputer<number> {
|
|
13
|
+
private exp;
|
|
14
|
+
constructor(exp: IValue);
|
|
15
|
+
get type(): _IType<any>;
|
|
16
|
+
createGroup(t: _Transaction): AggregationGroupComputer<number>;
|
|
17
|
+
}
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=count.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { _ISelection, AggregationComputer, IValue, _IType, _Transaction, AggregationGroupComputer } from '../../interfaces-private';
|
|
2
|
+
import { ExprCall } from 'pgsql-ast-parser';
|
|
3
|
+
declare class JsonAggExpr implements AggregationComputer<any[]> {
|
|
4
|
+
private exp;
|
|
5
|
+
readonly type: _IType;
|
|
6
|
+
constructor(exp: IValue, type: _IType);
|
|
7
|
+
createGroup(t: _Transaction): AggregationGroupComputer<any[]>;
|
|
8
|
+
}
|
|
9
|
+
export declare function buildJsonAgg(this: void, base: _ISelection, call: ExprCall, fn: 'json_agg' | 'jsonb_agg'): JsonAggExpr;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=json_aggs.d.ts.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AggregationComputer, AggregationGroupComputer, IValue, _ISelection, _IType, _Transaction } from '../../interfaces-private';
|
|
2
|
+
import { Expr } from 'pgsql-ast-parser';
|
|
3
|
+
declare class MinMax implements AggregationComputer<number> {
|
|
4
|
+
private exp;
|
|
5
|
+
private isMax;
|
|
6
|
+
constructor(exp: IValue, isMax: boolean);
|
|
7
|
+
get type(): _IType<any>;
|
|
8
|
+
createGroup(t: _Transaction): AggregationGroupComputer<number>;
|
|
9
|
+
}
|
|
10
|
+
export declare function buildMinMax(this: void, base: _ISelection, args: Expr[], op: 'max' | 'min'): MinMax;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=max-min.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AggregationComputer, AggregationGroupComputer, IValue, _ISelection, _IType, _Transaction } from '../../interfaces-private';
|
|
2
|
+
import { ExprCall } from 'pgsql-ast-parser';
|
|
3
|
+
declare class SumExpr implements AggregationComputer<number> {
|
|
4
|
+
private exp;
|
|
5
|
+
constructor(exp: IValue);
|
|
6
|
+
get type(): _IType<any>;
|
|
7
|
+
createGroup(t: _Transaction): AggregationGroupComputer<number>;
|
|
8
|
+
}
|
|
9
|
+
export declare function buildSum(this: void, base: _ISelection, call: ExprCall): SumExpr;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=sum.d.ts.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { TransformBase } from './transform-base';
|
|
2
|
+
import { _Transaction, IValue, _Explainer, _ISelection, _SelectExplanation, Stats, nil, _IAlias, Row } from '../interfaces-private';
|
|
3
|
+
import { ExprRef } from 'pgsql-ast-parser';
|
|
4
|
+
export declare function buildAlias(on: _ISelection, alias?: string): _ISelection;
|
|
5
|
+
export declare class Alias extends TransformBase implements _IAlias {
|
|
6
|
+
name: string;
|
|
7
|
+
private oldToThis;
|
|
8
|
+
private thisToOld;
|
|
9
|
+
private _columns;
|
|
10
|
+
private asRecord;
|
|
11
|
+
get isExecutionWithNoResult(): boolean;
|
|
12
|
+
constructor(sel: _ISelection, name: string);
|
|
13
|
+
listSelectableIdentities(): Iterable<IValue>;
|
|
14
|
+
rebuild(): void;
|
|
15
|
+
selectAlias(alias: string): _IAlias | nil;
|
|
16
|
+
listColumns(): Iterable<IValue>;
|
|
17
|
+
get debugId(): string | undefined;
|
|
18
|
+
get columns(): ReadonlyArray<IValue>;
|
|
19
|
+
init(): void;
|
|
20
|
+
stats(t: _Transaction): Stats | null;
|
|
21
|
+
enumerate(t: _Transaction): Iterable<Row>;
|
|
22
|
+
hasItem(value: Row, t: _Transaction): boolean;
|
|
23
|
+
getColumn(column: string | ExprRef): IValue;
|
|
24
|
+
getColumn(column: string | ExprRef, nullIfNotFound?: boolean): IValue | nil;
|
|
25
|
+
private _getColumn;
|
|
26
|
+
explain(e: _Explainer): _SelectExplanation;
|
|
27
|
+
getIndex(...forValue: IValue[]): nil | import("../interfaces-private")._IIndex;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=alias.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { _ISelection, _IIndex, _Transaction, _Explainer, _SelectExplanation, Stats, nil, Row } from '../interfaces-private';
|
|
2
|
+
import { FilterBase } from './transform-base';
|
|
3
|
+
export declare class AndFilter extends FilterBase {
|
|
4
|
+
private filters;
|
|
5
|
+
get index(): _IIndex | nil;
|
|
6
|
+
private prevEntropy?;
|
|
7
|
+
entropy(t: _Transaction): number;
|
|
8
|
+
hasItem(value: Row, t: _Transaction): boolean;
|
|
9
|
+
constructor(filters: _ISelection[]);
|
|
10
|
+
private plan;
|
|
11
|
+
stats(t: _Transaction): Stats | null;
|
|
12
|
+
enumerate(t: _Transaction): Iterable<Row>;
|
|
13
|
+
explain(e: _Explainer): _SelectExplanation;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=and-filter.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FilterBase } from './transform-base';
|
|
2
|
+
import { _ISelection, _Explainer, _SelectExplanation, _Transaction, Stats, Row } from '../interfaces-private';
|
|
3
|
+
export declare class ArrayFilter extends FilterBase {
|
|
4
|
+
rows: Row[];
|
|
5
|
+
get index(): null;
|
|
6
|
+
entropy(): number;
|
|
7
|
+
hasItem(raw: Row): boolean;
|
|
8
|
+
getIndex(): null;
|
|
9
|
+
constructor(fromTable: _ISelection, rows: Row[]);
|
|
10
|
+
enumerate(): Iterable<Row>;
|
|
11
|
+
stats(t: _Transaction): Stats | null;
|
|
12
|
+
explain(e: _Explainer): _SelectExplanation;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=array-filter.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IValue, _Transaction, _Explainer, _SelectExplanation, Stats, Row } from '../interfaces-private';
|
|
2
|
+
import { FilterBase } from './transform-base';
|
|
3
|
+
export declare class BetweenFilter extends FilterBase {
|
|
4
|
+
private onValue;
|
|
5
|
+
private lo;
|
|
6
|
+
private hi;
|
|
7
|
+
private op;
|
|
8
|
+
private opDef;
|
|
9
|
+
entropy(t: _Transaction): number;
|
|
10
|
+
constructor(onValue: IValue, lo: any, hi: any, op: 'inside' | 'outside');
|
|
11
|
+
hasItem(value: Row, t: _Transaction): boolean;
|
|
12
|
+
enumerate(t: _Transaction): Iterable<Row>;
|
|
13
|
+
stats(t: _Transaction): Stats | null;
|
|
14
|
+
explain(e: _Explainer): _SelectExplanation;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=between-filter.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Expr } from 'pgsql-ast-parser';
|
|
2
|
+
import { IValue, Row, Stats, _Explainer, _ISelection, _SelectExplanation, _Transaction } from '../interfaces-private';
|
|
3
|
+
import { FilterBase } from './transform-base';
|
|
4
|
+
export declare function buildDistinct(on: _ISelection, exprs?: Expr[]): Distinct;
|
|
5
|
+
declare class Distinct extends FilterBase {
|
|
6
|
+
private exprs;
|
|
7
|
+
get index(): null;
|
|
8
|
+
entropy(t: _Transaction): number;
|
|
9
|
+
hasItem(raw: Row, t: _Transaction): boolean;
|
|
10
|
+
constructor(selection: _ISelection, exprs: ReadonlyArray<IValue>);
|
|
11
|
+
stats(t: _Transaction): Stats | null;
|
|
12
|
+
enumerate(t: _Transaction): Iterable<Row>;
|
|
13
|
+
explain(e: _Explainer): _SelectExplanation;
|
|
14
|
+
}
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=distinct.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { IValue, _Transaction, _Explainer, _SelectExplanation, Stats, Row } from '../interfaces-private';
|
|
2
|
+
import { FilterBase } from './transform-base';
|
|
3
|
+
export declare class EqFilter extends FilterBase {
|
|
4
|
+
private onValue;
|
|
5
|
+
private equalsCst;
|
|
6
|
+
private op;
|
|
7
|
+
private matchNull;
|
|
8
|
+
private index;
|
|
9
|
+
private opDef;
|
|
10
|
+
entropy(t: _Transaction): number;
|
|
11
|
+
stats(t: _Transaction): Stats | null;
|
|
12
|
+
hasItem(item: Row, t: _Transaction): boolean;
|
|
13
|
+
constructor(onValue: IValue, equalsCst: any, op: 'eq' | 'neq', matchNull: boolean);
|
|
14
|
+
enumerate(t: _Transaction): Iterable<Row>;
|
|
15
|
+
explain(e: _Explainer): _SelectExplanation;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=eq-filter.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { _Explainer, _SelectExplanation, _Transaction, Stats, Row } from '../interfaces-private';
|
|
2
|
+
import { FilterBase } from './transform-base';
|
|
3
|
+
export declare class FalseFilter extends FilterBase {
|
|
4
|
+
get index(): null;
|
|
5
|
+
entropy(): number;
|
|
6
|
+
hasItem(): boolean;
|
|
7
|
+
enumerate(): Iterable<Row>;
|
|
8
|
+
stats(t: _Transaction): Stats | null;
|
|
9
|
+
explain(e: _Explainer): _SelectExplanation;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=false-filter.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { IValue, _Transaction, _Explainer, _SelectExplanation, Stats, Row } from '../interfaces-private';
|
|
2
|
+
import { FilterBase } from './transform-base';
|
|
3
|
+
export declare class InFilter extends FilterBase {
|
|
4
|
+
private onValue;
|
|
5
|
+
private elts;
|
|
6
|
+
private index;
|
|
7
|
+
entropy(t: _Transaction): number;
|
|
8
|
+
hasItem(item: Row, t: _Transaction): boolean;
|
|
9
|
+
constructor(onValue: IValue, elts: any[]);
|
|
10
|
+
stats(t: _Transaction): Stats | null;
|
|
11
|
+
enumerate(t: _Transaction): Iterable<Row>;
|
|
12
|
+
explain(e: _Explainer): _SelectExplanation;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=in-filter.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IValue, _Transaction, _Explainer, _SelectExplanation, Stats, Row } from '../interfaces-private';
|
|
2
|
+
import { FilterBase } from './transform-base';
|
|
3
|
+
export declare class IneqFilter extends FilterBase {
|
|
4
|
+
private onValue;
|
|
5
|
+
private op;
|
|
6
|
+
private than;
|
|
7
|
+
private index;
|
|
8
|
+
private opDef;
|
|
9
|
+
entropy(t: _Transaction): number;
|
|
10
|
+
hasItem(item: Row, t: _Transaction): boolean;
|
|
11
|
+
constructor(onValue: IValue, op: 'gt' | 'ge' | 'lt' | 'le', than: any);
|
|
12
|
+
stats(t: _Transaction): Stats | null;
|
|
13
|
+
enumerate(t: _Transaction): Iterable<Row>;
|
|
14
|
+
explain(e: _Explainer): _SelectExplanation;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=ineq-filter.d.ts.map
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { _ISelection, IValue, _IIndex, _Transaction, _SelectExplanation, _Explainer, IndexExpression, IndexOp, IndexKey, _IndexExplanation, Stats, _IAlias, Row } from '../interfaces-private';
|
|
2
|
+
import { nil } from '../interfaces';
|
|
3
|
+
import { DataSourceBase } from './transform-base';
|
|
4
|
+
import { ExprRef, JoinClause } from 'pgsql-ast-parser';
|
|
5
|
+
import { SELECT_ALL } from '../execution/clean-results';
|
|
6
|
+
interface JoinRaw {
|
|
7
|
+
'>restrictive': Row;
|
|
8
|
+
'>joined': Row;
|
|
9
|
+
}
|
|
10
|
+
interface JoinStrategy {
|
|
11
|
+
iterate: _ISelection;
|
|
12
|
+
iterateSide: 'joined' | 'restrictive';
|
|
13
|
+
joinIndex: _IIndex;
|
|
14
|
+
onValue: IValue;
|
|
15
|
+
othersPredicate?: IValue;
|
|
16
|
+
}
|
|
17
|
+
export declare class JoinSelection extends DataSourceBase {
|
|
18
|
+
readonly restrictive: _ISelection;
|
|
19
|
+
readonly joined: _ISelection;
|
|
20
|
+
readonly innerJoin: boolean;
|
|
21
|
+
get isExecutionWithNoResult(): boolean;
|
|
22
|
+
private _columns;
|
|
23
|
+
private seqScanExpression;
|
|
24
|
+
private joinId;
|
|
25
|
+
private columnsMappingParentToThis;
|
|
26
|
+
private indexOnRestrictingTableByValue;
|
|
27
|
+
private indexCache;
|
|
28
|
+
strategies: JoinStrategy[];
|
|
29
|
+
private building;
|
|
30
|
+
private ignoreDupes?;
|
|
31
|
+
private mergeSelect?;
|
|
32
|
+
isOriginOf(a: IValue): boolean;
|
|
33
|
+
get columns(): IValue[];
|
|
34
|
+
entropy(t: _Transaction): number;
|
|
35
|
+
constructor(restrictive: _ISelection, joined: _ISelection, on: JoinClause, innerJoin: boolean);
|
|
36
|
+
private wrap;
|
|
37
|
+
listSelectableIdentities(): Iterable<IValue>;
|
|
38
|
+
private fetchOnStrategies;
|
|
39
|
+
private fetchUsingStrategies;
|
|
40
|
+
private fetchAndStrategies;
|
|
41
|
+
private fetchEqStrategyOn;
|
|
42
|
+
getColumn(column: string | ExprRef): IValue;
|
|
43
|
+
getColumn(column: string | ExprRef, nullIfNotFound?: boolean): IValue | nil;
|
|
44
|
+
stats(t: _Transaction): Stats | null;
|
|
45
|
+
enumerate(t: _Transaction): Iterable<any>;
|
|
46
|
+
selectAlias(alias: string): _IAlias | nil;
|
|
47
|
+
iterateCatastrophicItem(item: any, others: any[], side: 'joined' | 'restrictive', t: _Transaction): Generator<any, void, unknown>;
|
|
48
|
+
private builder;
|
|
49
|
+
iterateStrategyItem(item: any, strategy: JoinStrategy, t: _Transaction): Generator<any, void, unknown>;
|
|
50
|
+
buildItem(l: Row, r: Row): {
|
|
51
|
+
'>joined': any;
|
|
52
|
+
'>restrictive': any;
|
|
53
|
+
[SELECT_ALL]: () => any;
|
|
54
|
+
};
|
|
55
|
+
private merge;
|
|
56
|
+
hasItem(value: JoinRaw): boolean;
|
|
57
|
+
getIndex(forValue: IValue): _IIndex | nil;
|
|
58
|
+
explain(e: _Explainer): _SelectExplanation;
|
|
59
|
+
}
|
|
60
|
+
export declare class JoinIndex implements _IIndex {
|
|
61
|
+
readonly owner: JoinSelection;
|
|
62
|
+
private base;
|
|
63
|
+
constructor(owner: JoinSelection, base: _IIndex);
|
|
64
|
+
get expressions(): IndexExpression[];
|
|
65
|
+
stats(t: _Transaction, key?: IndexKey): Stats | null;
|
|
66
|
+
iterateKeys(): null;
|
|
67
|
+
entropy(op: IndexOp): number;
|
|
68
|
+
eqFirst(rawKey: IndexKey, t: _Transaction): Row | null;
|
|
69
|
+
private chooseStrategy;
|
|
70
|
+
enumerate(op: IndexOp): Iterable<Row>;
|
|
71
|
+
explain(e: _Explainer): _IndexExplanation;
|
|
72
|
+
}
|
|
73
|
+
export {};
|
|
74
|
+
//# sourceMappingURL=join.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { IValue, _ISelection, _Transaction, _Explainer, _SelectExplanation, Stats, nil, Row } from '../interfaces-private';
|
|
2
|
+
import { FilterBase } from './transform-base';
|
|
3
|
+
import { LimitStatement } from 'pgsql-ast-parser';
|
|
4
|
+
export declare function buildLimit(on: _ISelection, limit: LimitStatement): LimitFilter;
|
|
5
|
+
declare class LimitFilter extends FilterBase {
|
|
6
|
+
private selection;
|
|
7
|
+
private take;
|
|
8
|
+
private skip;
|
|
9
|
+
get index(): null;
|
|
10
|
+
entropy(t: _Transaction): number;
|
|
11
|
+
hasItem(raw: Row, t: _Transaction): boolean;
|
|
12
|
+
constructor(selection: _ISelection, take: IValue | nil, skip: IValue | nil);
|
|
13
|
+
stats(t: _Transaction): Stats | null;
|
|
14
|
+
enumerate(t: _Transaction): Iterable<Row>;
|
|
15
|
+
explain(e: _Explainer): _SelectExplanation;
|
|
16
|
+
}
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=limit.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { IValue, _Transaction, _Explainer, _SelectExplanation, Stats, Row } from '../interfaces-private';
|
|
2
|
+
import { FilterBase } from './transform-base';
|
|
3
|
+
export declare class NotInFilter extends FilterBase {
|
|
4
|
+
private onValue;
|
|
5
|
+
private elts;
|
|
6
|
+
private index;
|
|
7
|
+
private keys;
|
|
8
|
+
entropy(t: _Transaction): number;
|
|
9
|
+
hasItem(item: Row, t: _Transaction): boolean;
|
|
10
|
+
constructor(onValue: IValue, elts: any[]);
|
|
11
|
+
stats(t: _Transaction): Stats | null;
|
|
12
|
+
enumerate(t: _Transaction): Iterable<Row>;
|
|
13
|
+
explain(e: _Explainer): _SelectExplanation;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=not-in-filter.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { _ISelection, _Transaction, _Explainer, _SelectExplanation, Stats, Row } from '../interfaces-private';
|
|
2
|
+
import { FilterBase } from './transform-base';
|
|
3
|
+
export declare class OrFilter extends FilterBase {
|
|
4
|
+
private left;
|
|
5
|
+
private right;
|
|
6
|
+
entropy(t: _Transaction): number;
|
|
7
|
+
hasItem(value: Row, t: _Transaction): boolean;
|
|
8
|
+
constructor(left: _ISelection, right: _ISelection);
|
|
9
|
+
stats(t: _Transaction): Stats | null;
|
|
10
|
+
enumerate(t: _Transaction): Iterable<Row>;
|
|
11
|
+
explain(e: _Explainer): _SelectExplanation;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=or-filter.d.ts.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { IValue, _ISelection, _Transaction, _Explainer, _SelectExplanation, Stats, _IAggregation, Row } from '../interfaces-private';
|
|
2
|
+
import { FilterBase } from './transform-base';
|
|
3
|
+
import { OrderByStatement, ExprCall } from 'pgsql-ast-parser';
|
|
4
|
+
export declare function buildOrderBy(on: _ISelection, order: OrderByStatement[]): OrderBy;
|
|
5
|
+
declare class OrderBy extends FilterBase implements _IAggregation {
|
|
6
|
+
private selection;
|
|
7
|
+
order: {
|
|
8
|
+
by: IValue;
|
|
9
|
+
order: 'ASC' | 'DESC';
|
|
10
|
+
nullsLast: boolean;
|
|
11
|
+
}[];
|
|
12
|
+
get index(): null;
|
|
13
|
+
isAggregation(): this is _IAggregation;
|
|
14
|
+
getAggregation(name: string, call: ExprCall): IValue;
|
|
15
|
+
checkIfIsKey(got: IValue): IValue;
|
|
16
|
+
private get asAggreg();
|
|
17
|
+
entropy(t: _Transaction): number;
|
|
18
|
+
hasItem(raw: Row, t: _Transaction): boolean;
|
|
19
|
+
constructor(selection: _ISelection, order: OrderByStatement[]);
|
|
20
|
+
stats(t: _Transaction): Stats | null;
|
|
21
|
+
getIndex(...forValue: IValue[]): import("../interfaces").nil | import("../interfaces-private")._IIndex;
|
|
22
|
+
enumerate(t: _Transaction): Iterable<Row>;
|
|
23
|
+
explain(e: _Explainer): _SelectExplanation;
|
|
24
|
+
}
|
|
25
|
+
export {};
|
|
26
|
+
//# sourceMappingURL=order-by.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { _IIndex, IndexExpression, _Transaction, IndexKey, _Explainer, _IndexExplanation, IndexOp, _ISelection, Stats, Row } from '../interfaces-private';
|
|
2
|
+
export declare class RestrictiveIndex implements _IIndex {
|
|
3
|
+
private base;
|
|
4
|
+
readonly filter: _ISelection;
|
|
5
|
+
constructor(base: _IIndex, filter: _ISelection);
|
|
6
|
+
private match;
|
|
7
|
+
get expressions(): IndexExpression[];
|
|
8
|
+
stats(t: _Transaction, key?: IndexKey): Stats | null;
|
|
9
|
+
iterateKeys(): null;
|
|
10
|
+
eqFirst(rawKey: IndexKey, t: _Transaction): any;
|
|
11
|
+
entropy(t: IndexOp): number;
|
|
12
|
+
enumerate(op: IndexOp): Iterable<Row>;
|
|
13
|
+
explain(e: _Explainer): _IndexExplanation;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=restrictive-index.d.ts.map
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { _ISelection, _IIndex, IValue, _IType, _Transaction, _Explainer, _SelectExplanation, IndexKey, _IndexExplanation, IndexExpression, IndexOp, Stats, _IAggregation, Row } from '../interfaces-private';
|
|
2
|
+
import { nil } from '../interfaces';
|
|
3
|
+
import { Evaluator, EvaluatorOptions } from '../evaluator';
|
|
4
|
+
import { TransformBase } from './transform-base';
|
|
5
|
+
import { SelectedColumn, Expr, ExprRef } from 'pgsql-ast-parser';
|
|
6
|
+
export declare function buildSelection(on: _ISelection, select: SelectedColumn[] | nil): _ISelection | Selection;
|
|
7
|
+
export declare function columnEvaluator(this: void, on: _ISelection, id: string, type: _IType, opts?: EvaluatorOptions): Evaluator<any>;
|
|
8
|
+
export interface CustomAlias {
|
|
9
|
+
val: IValue;
|
|
10
|
+
as?: string;
|
|
11
|
+
expr?: Expr;
|
|
12
|
+
}
|
|
13
|
+
export declare class Selection extends TransformBase implements _ISelection {
|
|
14
|
+
private columnIds;
|
|
15
|
+
private columnsOrigin;
|
|
16
|
+
private columnMapping;
|
|
17
|
+
private indexCache;
|
|
18
|
+
private columnsById;
|
|
19
|
+
private symbol;
|
|
20
|
+
readonly columns: IValue[];
|
|
21
|
+
isAggregation(): this is _IAggregation;
|
|
22
|
+
constructor(base: _ISelection, _columns: (SelectedColumn | CustomAlias)[]);
|
|
23
|
+
private refColumn;
|
|
24
|
+
stats(t: _Transaction): Stats | null;
|
|
25
|
+
enumerate(t: _Transaction): Iterable<Row>;
|
|
26
|
+
build(item: any, t: _Transaction): Row;
|
|
27
|
+
hasItem(value: Row, t: _Transaction): boolean;
|
|
28
|
+
getColumn(column: string | ExprRef): IValue;
|
|
29
|
+
getColumn(column: string | ExprRef, nullIfNotFound?: boolean): IValue | nil;
|
|
30
|
+
getIndex(val: IValue): _IIndex | nil;
|
|
31
|
+
explain(e: _Explainer): _SelectExplanation;
|
|
32
|
+
}
|
|
33
|
+
export declare class SelectionIndex implements _IIndex {
|
|
34
|
+
readonly owner: Selection;
|
|
35
|
+
private base;
|
|
36
|
+
constructor(owner: Selection, base: _IIndex);
|
|
37
|
+
stats(t: _Transaction, key?: IndexKey): Stats | null;
|
|
38
|
+
iterateKeys(t: _Transaction): Iterable<IndexKey> | null;
|
|
39
|
+
get expressions(): IndexExpression[];
|
|
40
|
+
entropy(op: IndexOp): number;
|
|
41
|
+
eqFirst(rawKey: IndexKey, t: _Transaction): any;
|
|
42
|
+
enumerate(op: IndexOp): Iterable<Row>;
|
|
43
|
+
explain(e: _Explainer): _IndexExplanation;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=selection.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { IValue, _ISelection, _Transaction, _Explainer, _SelectExplanation, Stats, Row } from '../interfaces-private';
|
|
2
|
+
import { FilterBase } from './transform-base';
|
|
3
|
+
export declare class SeqScanFilter extends FilterBase {
|
|
4
|
+
private selection;
|
|
5
|
+
private getter;
|
|
6
|
+
get index(): null;
|
|
7
|
+
entropy(t: _Transaction): number;
|
|
8
|
+
hasItem(raw: Row, t: _Transaction): boolean;
|
|
9
|
+
constructor(selection: _ISelection, getter: IValue);
|
|
10
|
+
stats(t: _Transaction): Stats | null;
|
|
11
|
+
enumerate(t: _Transaction): Iterable<Row>;
|
|
12
|
+
explain(e: _Explainer): _SelectExplanation;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=seq-scan.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { IValue, _Transaction, _Explainer, _SelectExplanation, Stats, Row } from '../interfaces-private';
|
|
2
|
+
import { FilterBase } from './transform-base';
|
|
3
|
+
export declare class StartsWithFilter extends FilterBase {
|
|
4
|
+
private onValue;
|
|
5
|
+
private startWith;
|
|
6
|
+
get index(): null;
|
|
7
|
+
entropy(t: _Transaction): number;
|
|
8
|
+
hasItem(item: Row, t: _Transaction): boolean;
|
|
9
|
+
constructor(onValue: IValue, startWith: string);
|
|
10
|
+
stats(t: _Transaction): Stats | null;
|
|
11
|
+
enumerate(t: _Transaction): Iterable<Row>;
|
|
12
|
+
explain(e: _Explainer): _SelectExplanation;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=startswith-filter.d.ts.map
|