@nongt/visql-core 0.9.0 → 0.10.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/dist/core.js +83 -80
- package/dist/explain.js +325 -134
- package/dist/{issueLocation-BOSdd1JX.js → issueLocation-Y1iaP_Cs.js} +176 -174
- package/dist/{params-MMOdKWnW.js → params-kc6eNrpu.js} +501 -495
- package/dist/{schema-dP_ISylQ.js → schema-KDJ1rpG5.js} +333 -298
- package/dist/sql-import.js +1 -1
- package/dist/{sqlGen-B7-2-i9V.js → sqlGen-Crgheqys.js} +33 -33
- package/dist/types/core/pipelineFlow.d.ts +1 -1
- package/dist/types/core/schema.d.ts +51 -22
- package/dist/types/core-api.d.ts +1 -1
- package/dist/types/explain/explainQuery.d.ts +12 -6
- package/package.json +1 -1
package/dist/sql-import.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var Ct = Object.defineProperty;
|
|
2
2
|
var Lt = (o, T, D) => T in o ? Ct(o, T, { enumerable: !0, configurable: !0, writable: !0, value: D }) : o[T] = D;
|
|
3
3
|
var It = (o, T, D) => Lt(o, typeof T != "symbol" ? T + "" : T, D);
|
|
4
|
-
import {
|
|
4
|
+
import { k as Dt, l as nt, p as gt, D as Ut, n as bt, d as Rt, o as Mt, q as qt, j as Nt, u as wt, w as xt, x as Ft, t as $t, m as Bt, y as Wt } from "./schema-KDJ1rpG5.js";
|
|
5
5
|
import { t as Pt, f as _t, a as Gt } from "./calendarDate-CYlr9TvX.js";
|
|
6
6
|
function kt(o, T, D = T) {
|
|
7
7
|
const k = o.slice(0, T);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var bt = Object.defineProperty;
|
|
2
2
|
var Mt = (t, r, e) => r in t ? bt(t, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[r] = e;
|
|
3
3
|
var w = (t, r, e) => Mt(t, typeof r != "symbol" ? r + "" : r, e);
|
|
4
|
-
import { q as _, d as F,
|
|
5
|
-
import {
|
|
4
|
+
import { q as _, d as F, a as Lt, s as wt, m as X, e as st, g as Ft, t as Ut, j as qt, b as _t, i as Yt } from "./schema-KDJ1rpG5.js";
|
|
5
|
+
import { p as K, t as Z, v as Ht, w as jt, x as Pt, y as ot, z as vt, A as Bt } from "./params-kc6eNrpu.js";
|
|
6
6
|
import { s as it } from "./calendarDate-CYlr9TvX.js";
|
|
7
7
|
class Gt extends Error {
|
|
8
8
|
constructor(e, n, s, i) {
|
|
@@ -60,34 +60,34 @@ function $t(t, r, e, n, s = new Set(at(r))) {
|
|
|
60
60
|
const c = /* @__PURE__ */ new Map([[e.table, e.ref]]), f = /* @__PURE__ */ new Map(), $ = [], l = new Set(s), A = (g) => {
|
|
61
61
|
const O = f.get(g);
|
|
62
62
|
return O ? [...A(O.ref), O.tie] : [];
|
|
63
|
-
},
|
|
63
|
+
}, y = (g, O, j) => {
|
|
64
64
|
if (O === g.length) return d(A(c.get(j)));
|
|
65
|
-
const
|
|
65
|
+
const D = g[O], M = wt(t, [...c.keys()], D);
|
|
66
66
|
if (!M) return !1;
|
|
67
|
-
const Q = c.get(Z(M.on).find((T) => T !==
|
|
68
|
-
c.set(
|
|
69
|
-
}, Ct = (T, I) => (z(T, I), d(A(T)) &&
|
|
67
|
+
const Q = c.get(Z(M.on).find((T) => T !== D)), V = (T) => B(M.on, new Map([...c, [D, T]])), J = i.includes(D), z = (T, I) => {
|
|
68
|
+
c.set(D, T), f.set(T, { ref: Q, tie: I });
|
|
69
|
+
}, Ct = (T, I) => (z(T, I), d(A(T)) && y(g, O + 1, j) ? !0 : (c.delete(D), f.delete(T), !1));
|
|
70
70
|
if (u.some((T) => {
|
|
71
|
-
if (T.table !==
|
|
72
|
-
const I = T.alias ??
|
|
71
|
+
if (T.table !== D) return !1;
|
|
72
|
+
const I = T.alias ?? D, P = kt(r, V(I), Q, I, J);
|
|
73
73
|
return (P.forward || P.back) && Ct(I, P);
|
|
74
74
|
})) return !0;
|
|
75
75
|
if (!a) return !1;
|
|
76
|
-
let p =
|
|
77
|
-
for (let T = 2; l.has(p); T += 1) p = `${
|
|
76
|
+
let p = D;
|
|
77
|
+
for (let T = 2; l.has(p); T += 1) p = `${D}_${T}`;
|
|
78
78
|
return l.add(p), z(p, { back: !0, forward: M.joinType === "inner" || J }), $.push({
|
|
79
79
|
id: Ht(),
|
|
80
|
-
table:
|
|
81
|
-
...p !==
|
|
80
|
+
table: D,
|
|
81
|
+
...p !== D ? { alias: p } : {},
|
|
82
82
|
joinType: M.joinType,
|
|
83
83
|
on: V(p)
|
|
84
|
-
}),
|
|
84
|
+
}), y(g, O + 1, j);
|
|
85
85
|
};
|
|
86
86
|
let R;
|
|
87
87
|
if (i.every((g) => {
|
|
88
88
|
if (R || c.has(g)) return !0;
|
|
89
|
-
const O = Lt(t, [...c.keys()], g);
|
|
90
|
-
return O ?
|
|
89
|
+
const O = Lt(t, [...c.keys()], g, { anyShape: !0 });
|
|
90
|
+
return O ? y(O, 0, g) : (R = g, !0);
|
|
91
91
|
}))
|
|
92
92
|
return l.forEach((g) => s.add(g)), { joins: $, condition: B(n.condition, c), ...R ? { missing: R } : {} };
|
|
93
93
|
};
|
|
@@ -275,7 +275,7 @@ function Tt(t, r) {
|
|
|
275
275
|
};
|
|
276
276
|
return { query: n(t), params: e };
|
|
277
277
|
}
|
|
278
|
-
const gr = ["mysql", "mssql", "postgres"],
|
|
278
|
+
const gr = ["mysql", "mssql", "postgres"], yr = {
|
|
279
279
|
mysql: "MySQL",
|
|
280
280
|
mssql: "SQL Server",
|
|
281
281
|
postgres: "PostgreSQL"
|
|
@@ -295,7 +295,7 @@ function S(t, r) {
|
|
|
295
295
|
}
|
|
296
296
|
const Jt = /^[A-Za-z_][A-Za-z0-9_]*$/, At = (t) => `${t}`, zt = /\uE000(\d+)\uE000/g;
|
|
297
297
|
let C;
|
|
298
|
-
function
|
|
298
|
+
function Dr(t, r) {
|
|
299
299
|
C = { ...t, writing: [] };
|
|
300
300
|
try {
|
|
301
301
|
return r();
|
|
@@ -369,7 +369,7 @@ function gt(t, r, e) {
|
|
|
369
369
|
return typeof t == "number" || typeof t == "bigint" ? String(t) : t instanceof Date ? `'${it(t)}'` : String(t);
|
|
370
370
|
}
|
|
371
371
|
let q = "native";
|
|
372
|
-
function
|
|
372
|
+
function yt(t, r) {
|
|
373
373
|
q = t ?? "native";
|
|
374
374
|
try {
|
|
375
375
|
return r();
|
|
@@ -568,15 +568,15 @@ const v = {
|
|
|
568
568
|
STRING_AGG: ([t = "??"], r, e, n, s, i) => {
|
|
569
569
|
const u = r[1] ?? { type: "literal", value: ", " }, o = u.type === "literal" && typeof u.value == "string" ? gt(u.value, e) : "??", a = s.distinct ? "DISTINCT " : "", c = (l) => {
|
|
570
570
|
var A;
|
|
571
|
-
return (A = s.orderBy) != null && A.length ? `ORDER BY ${s.orderBy.map((
|
|
571
|
+
return (A = s.orderBy) != null && A.length ? `ORDER BY ${s.orderBy.map((y) => `${l(y)} ${y.direction === "desc" ? "DESC" : "ASC"}`).join(", ")}` : "";
|
|
572
572
|
}, f = (l) => i(l.expression), $ = (l) => l ? ` ${l}` : "";
|
|
573
573
|
switch (e) {
|
|
574
574
|
case "mysql":
|
|
575
575
|
return `GROUP_CONCAT(${a}${t}${$(c(f))} SEPARATOR ${o})`;
|
|
576
576
|
case "postgres": {
|
|
577
|
-
const l = `CAST(${t} AS TEXT)`, A = c((
|
|
578
|
-
if (!s.distinct) return f(
|
|
579
|
-
if (F(
|
|
577
|
+
const l = `CAST(${t} AS TEXT)`, A = c((y) => {
|
|
578
|
+
if (!s.distinct) return f(y);
|
|
579
|
+
if (F(y.expression, r[0])) return l;
|
|
580
580
|
throw new Error("PostgreSQL orders STRING_AGG of different values by the value only");
|
|
581
581
|
});
|
|
582
582
|
return `STRING_AGG(${a}${l}, ${o}${$(A)})`;
|
|
@@ -652,9 +652,9 @@ function rr(t, r, e, n) {
|
|
|
652
652
|
return t.right.type === "list" ? `${c} IN ${E(t.right, r, e, n)}` : `${c} IN (${E(t.right, r, e, n)})`;
|
|
653
653
|
const f = E(t.right, r, e, n), $ = N(t.right) ? `(${f})` : f;
|
|
654
654
|
if (t.operator === "IS NOT DISTINCT FROM" && q === "expanded") {
|
|
655
|
-
const l = (
|
|
656
|
-
const R = E(
|
|
657
|
-
return N(
|
|
655
|
+
const l = (y) => {
|
|
656
|
+
const R = E(y, r, e, n);
|
|
657
|
+
return N(y) ? `(${R})` : R;
|
|
658
658
|
}, A = `${l(t.left)} IS NULL AND ${l(t.right)} IS NULL`;
|
|
659
659
|
return `(${c} = ${$} OR (${A}))`;
|
|
660
660
|
}
|
|
@@ -729,7 +729,7 @@ ${[
|
|
|
729
729
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
730
730
|
...o.joins.map((l) => pt(l, r, n)),
|
|
731
731
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
732
|
-
|
|
732
|
+
Dt(f, r, n)
|
|
733
733
|
].join(`
|
|
734
734
|
`).replace(/^/gm, i)}
|
|
735
735
|
${s})`;
|
|
@@ -748,7 +748,7 @@ ${s}`;
|
|
|
748
748
|
return "/* unknown */";
|
|
749
749
|
}
|
|
750
750
|
}
|
|
751
|
-
function
|
|
751
|
+
function Dt(t, r, e) {
|
|
752
752
|
return `WHERE
|
|
753
753
|
${E(t, r, 1, e)}`;
|
|
754
754
|
}
|
|
@@ -835,7 +835,7 @@ function W(t, r, e, n = `SELECT${t.distinct ? " DISTINCT" : ""}`) {
|
|
|
835
835
|
Rt(t.from, r, e),
|
|
836
836
|
...t.joins.map((u) => pt(u, r, e))
|
|
837
837
|
];
|
|
838
|
-
t.where && s.push(
|
|
838
|
+
t.where && s.push(Dt(t.where, r, e));
|
|
839
839
|
const i = t.groupBy ?? [];
|
|
840
840
|
if (i.length > 0 && s.push(or(i, r, e)), t.having) {
|
|
841
841
|
const u = r === "mysql" ? ot(t.having, t) : t.having;
|
|
@@ -861,7 +861,7 @@ function ht(t, r, e) {
|
|
|
861
861
|
}
|
|
862
862
|
function Or(t, r, e = {}) {
|
|
863
863
|
const n = e.values ? Pt(t, e.values) : t, s = e.schema ? Tt(n, e.schema).query : n, i = It(s, e);
|
|
864
|
-
return
|
|
864
|
+
return yt(e.nullSafeEqual, () => ht(i, r));
|
|
865
865
|
}
|
|
866
866
|
function ar(t, r) {
|
|
867
867
|
switch (t) {
|
|
@@ -882,7 +882,7 @@ function Nr(t, r, e = {}) {
|
|
|
882
882
|
const $ = n.params.get(c);
|
|
883
883
|
return [c, $ ? Et(f, $) : f];
|
|
884
884
|
}))
|
|
885
|
-
}, i = It(n.query, e), u =
|
|
885
|
+
}, i = It(n.query, e), u = yt(
|
|
886
886
|
e.nullSafeEqual,
|
|
887
887
|
() => ht(i, r, s)
|
|
888
888
|
), o = [];
|
|
@@ -896,8 +896,8 @@ export {
|
|
|
896
896
|
Gt as S,
|
|
897
897
|
Nr as a,
|
|
898
898
|
Or as b,
|
|
899
|
-
|
|
899
|
+
yr as c,
|
|
900
900
|
Ar as s,
|
|
901
901
|
mr as u,
|
|
902
|
-
|
|
902
|
+
Dr as w
|
|
903
903
|
};
|
|
@@ -140,7 +140,7 @@ export declare function referencedTables(ast: ExpressionNode | undefined): strin
|
|
|
140
140
|
/** Auto-adds (via addJoin's own suggestJoin logic) every table referenced by
|
|
141
141
|
* a field in `ast` that the pipeline doesn't already have. A table with no
|
|
142
142
|
* direct relation to anything already present gets the intermediate tables
|
|
143
|
-
* it needs added first (
|
|
143
|
+
* it needs added first (joinAlong) — e.g. picking a product_category
|
|
144
144
|
* column with only sale_transaction in FROM adds product, then
|
|
145
145
|
* product_category — so each added join gets a real suggested ON condition
|
|
146
146
|
* instead of an unconnected one. A table nothing connects to at all is still
|
|
@@ -109,6 +109,24 @@ export declare function relationsForTable(schema: DatabaseSchema, tableName: str
|
|
|
109
109
|
* (`fromTable`), so callers never need to know which side is "many". When
|
|
110
110
|
* several keys connect the same two tables, the first declared wins. */
|
|
111
111
|
export declare function findRelation(schema: DatabaseSchema, tableA: string, tableB: string): Relation | undefined;
|
|
112
|
+
/** How findJoinPath and reachableTables may walk the relations. */
|
|
113
|
+
export interface JoinPathOptions {
|
|
114
|
+
/** Walk any path. By default a path never takes a one-to-many step
|
|
115
|
+
* (down: from a relation's `toTable` to its `fromTable`) after a
|
|
116
|
+
* many-to-one step (up), counting how the query's own tables were
|
|
117
|
+
* reached: `hours → employee → punch` pairs each hours row with every
|
|
118
|
+
* punch of its employee, on any day. A path is up only, or down and then
|
|
119
|
+
* up. scopeQuery walks any path: a rule can go up to a tenant and down to
|
|
120
|
+
* who may see it. */
|
|
121
|
+
anyShape?: boolean;
|
|
122
|
+
/** reachableTables: tables neither reached nor walked through. */
|
|
123
|
+
skip?: ReadonlySet<string>;
|
|
124
|
+
}
|
|
125
|
+
/** findJoinPath's path, with the table of the query it starts from. */
|
|
126
|
+
export declare function joinRoute(schema: DatabaseSchema, existingTables: string[], target: string, options?: JoinPathOptions): {
|
|
127
|
+
start: string;
|
|
128
|
+
tables: string[];
|
|
129
|
+
} | undefined;
|
|
112
130
|
/** The chain of tables connecting `target` to any of `existingTables`
|
|
113
131
|
* through the relation graph (walked in both directions), as the tables
|
|
114
132
|
* that would need to be added, in join order, intermediates first, ending
|
|
@@ -119,33 +137,44 @@ export declare function findRelation(schema: DatabaseSchema, tableA: string, tab
|
|
|
119
137
|
* Of all the chains, the one with the fewest fan-out steps, then the
|
|
120
138
|
* fewest steps (issue 6). A fan-out step walks a relation from its `toTable`
|
|
121
139
|
* to its `fromTable`, one row to many, which repeats the rows before it.
|
|
122
|
-
*
|
|
123
|
-
*
|
|
124
|
-
*
|
|
125
|
-
*
|
|
126
|
-
*
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
*
|
|
131
|
-
* but nothing past it. */
|
|
132
|
-
export declare function reachableTables(schema: DatabaseSchema, existingTables: string[]): Set<string>;
|
|
140
|
+
* None comes after a step the other way, unless `options.anyShape`
|
|
141
|
+
* (JoinPathOptions). Ties go the way a breadth-first walk would: seeded in
|
|
142
|
+
* `existingTables` order, neighbours in `relations` order, so the result
|
|
143
|
+
* is deterministic. A table with `passThrough: false` is never a step (see
|
|
144
|
+
* startsOf for where it may start). Returns [] when `target` is already
|
|
145
|
+
* present, undefined when nothing connects it. */
|
|
146
|
+
export declare function findJoinPath(schema: DatabaseSchema, existingTables: string[], target: string, options?: JoinPathOptions): string[] | undefined;
|
|
147
|
+
/** Every table the relation graph reaches from `existingTables`, them
|
|
148
|
+
* included: what findJoinPath finds a path to, for all tables in one walk.
|
|
149
|
+
* A table with `passThrough: false` is reached, but nothing past it. */
|
|
150
|
+
export declare function reachableTables(schema: DatabaseSchema, existingTables: string[], options?: JoinPathOptions): Set<string>;
|
|
133
151
|
export interface JoinSuggestion {
|
|
134
152
|
joinType: JoinType;
|
|
135
153
|
on: ExpressionNode;
|
|
136
154
|
}
|
|
155
|
+
export interface SuggestJoinOptions {
|
|
156
|
+
/** The table before `newTable` on its join path (joinRoute): the join is
|
|
157
|
+
* tied to it, when they're related, rather than to the first table of
|
|
158
|
+
* the query that is. */
|
|
159
|
+
after?: string;
|
|
160
|
+
/** The query's tables on the optional side of a LEFT or FULL join. A
|
|
161
|
+
* join tied to one of them is LEFT too, whatever its key: an INNER join
|
|
162
|
+
* there would drop the rows the LEFT join kept. */
|
|
163
|
+
leftJoined?: string[];
|
|
164
|
+
}
|
|
137
165
|
/** Suggests a join type + ON condition for adding `newTable` alongside the
|
|
138
|
-
* tables already in the pipeline, using the relation graph.
|
|
139
|
-
*
|
|
140
|
-
*
|
|
141
|
-
*
|
|
142
|
-
*
|
|
143
|
-
*
|
|
144
|
-
*
|
|
145
|
-
*
|
|
146
|
-
*
|
|
147
|
-
* anything already
|
|
148
|
-
|
|
166
|
+
* tables already in the pipeline, using the relation graph. Tied to
|
|
167
|
+
* `options.after` when it's related; else tries each existing table in
|
|
168
|
+
* order (base table first, then join-insertion order) and the first
|
|
169
|
+
* relation found wins, so the result is deterministic. A table with
|
|
170
|
+
* `passThrough: false` is tried only for itself, or when the query has no
|
|
171
|
+
* other table (startsOf). `joinType` is 'left' when the relation's FK
|
|
172
|
+
* column (`fromColumn`) is nullable (e.g. sale_transaction.promotion_id:
|
|
173
|
+
* an INNER join there would silently drop unpromoted sales) or the table
|
|
174
|
+
* it's tied to is in `options.leftJoined`, and 'inner' otherwise. Returns
|
|
175
|
+
* undefined if no relation connects `newTable` to anything already
|
|
176
|
+
* present. */
|
|
177
|
+
export declare function suggestJoin(schema: DatabaseSchema, existingTables: string[], newTable: string, options?: SuggestJoinOptions): JoinSuggestion | undefined;
|
|
149
178
|
export type SchemaIssueKind = 'duplicateTable' | 'duplicateColumn' | 'unknownTable' | 'unknownColumn' | 'duplicateRelation' | 'invalidFormat';
|
|
150
179
|
export interface SchemaIssue {
|
|
151
180
|
kind: SchemaIssueKind;
|
package/dist/types/core-api.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ export { relativeDateLabel } from './core/relativeDates.js';
|
|
|
14
14
|
export { QUERY_FORMAT_VERSION, QueryFormatError, loadQuery, saveQuery, type StoredQuery, } from './core/storedQuery.js';
|
|
15
15
|
export type { ResolveName } from './core/resolveNames.js';
|
|
16
16
|
export { astToParameterizedSql, astToSql, DIALECTS, DIALECT_LABELS, type NullSafeEqual, type ParameterizedSql, type ParameterizedSqlOptions, type SqlDialect, } from './core/sqlGen.js';
|
|
17
|
-
export { EMPTY_SCHEMA, filterSchema, validateSchema, type DatabaseColumnType, type DatabaseSchema, type ColumnOption, type Relation, type SchemaIssue, type SchemaIssueKind, type Table, type TableColumn, type TableGroup, } from './core/schema.js';
|
|
17
|
+
export { EMPTY_SCHEMA, filterSchema, validateSchema, type DatabaseColumnType, type DatabaseSchema, type ColumnOption, type Relation, findJoinPath, reachableTables, suggestJoin, type JoinPathOptions, type JoinSuggestion, type SuggestJoinOptions, type SchemaIssue, type SchemaIssueKind, type Table, type TableColumn, type TableGroup, } from './core/schema.js';
|
|
18
18
|
export { QUERY_ISSUE_KINDS, QUERY_WARNING_KINDS, validateQuery, type QueryIssue, type QueryIssueKind, type QueryWarningKind, type QueryIssueSeverity, type ValidateQueryOptions, } from './core/queryValidation.js';
|
|
19
19
|
export type { OnExplain, PlanFinding, PlanFindingKind } from './core/planFindings.js';
|
|
20
20
|
export { default as issueLocation, type IssueLocationStep } from './core/issueLocation.js';
|
|
@@ -3,7 +3,7 @@ import type { QueryPipeline } from '../core/queryAst.js';
|
|
|
3
3
|
import { type ScopeRule } from '../core/scopeQuery.js';
|
|
4
4
|
import { type ParameterizedSqlOptions } from '../core/sqlGen.js';
|
|
5
5
|
/** The databases whose plans can be read. */
|
|
6
|
-
export type ExplainDialect = 'postgres';
|
|
6
|
+
export type ExplainDialect = 'postgres' | 'mssql' | 'mysql';
|
|
7
7
|
export interface ExplainOptions extends ParameterizedSqlOptions {
|
|
8
8
|
/** The rule the query runs under (see scopeQuery), so the plan is the
|
|
9
9
|
* one the query really gets. Needs `schema`. */
|
|
@@ -11,20 +11,26 @@ export interface ExplainOptions extends ParameterizedSqlOptions {
|
|
|
11
11
|
}
|
|
12
12
|
export interface PlanReadOptions {
|
|
13
13
|
/** How many rows each table has, by its name in the database, e.g. from
|
|
14
|
-
* `SELECT relname, reltuples FROM pg_class`. A plan only
|
|
15
|
-
* scan returns, after its filter: with the sizes, a big
|
|
16
|
-
* whole for a few rows is reported as a missing index.
|
|
14
|
+
* `SELECT relname, reltuples FROM pg_class`. A PostgreSQL plan only
|
|
15
|
+
* gives the rows a scan returns, after its filter: with the sizes, a big
|
|
16
|
+
* table read whole for a few rows is reported as a missing index. SQL
|
|
17
|
+
* Server's plan has them itself. */
|
|
17
18
|
tableRows?: Record<string, number> | ((table: string) => number | undefined);
|
|
18
19
|
/** Below this many rows, nothing is reported. Default 10,000. */
|
|
19
20
|
minRows?: number;
|
|
20
21
|
}
|
|
21
22
|
export interface ExplainedQuery {
|
|
23
|
+
/** SQL Server: run on the same connection before `sql`, as a batch of
|
|
24
|
+
* its own, and `after` once the plan is back. */
|
|
25
|
+
before?: string;
|
|
22
26
|
/** The statement to run, EXPLAIN included, with `params` bound. */
|
|
23
27
|
sql: string;
|
|
24
28
|
params: unknown[];
|
|
29
|
+
after?: string;
|
|
25
30
|
/** What the plan EXPLAIN gave says, on the parts of the query given to
|
|
26
|
-
* explainQuery. Takes the plan as the driver returns it (
|
|
27
|
-
* `QUERY PLAN` column
|
|
31
|
+
* explainQuery. Takes the plan as the driver returns it (PostgreSQL:
|
|
32
|
+
* rows with a `QUERY PLAN` column; SQL Server: the showplan's row) or as
|
|
33
|
+
* its JSON or XML text. */
|
|
28
34
|
findings: (plan: unknown, options?: PlanReadOptions) => PlanFinding[];
|
|
29
35
|
}
|
|
30
36
|
/** A table, sub query or shared query's place in the query, under the name
|
package/package.json
CHANGED