@tabularis/explain 0.2.0 → 0.3.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 +6 -3
- package/dist/{diagnostics-DPSgsjFk.d.ts → diagnostics-DYKMtJZS.d.ts} +4 -4
- package/dist/flow.d.ts +1 -1
- package/dist/flow.js +2 -8
- package/dist/index.d.ts +157 -19
- package/dist/index.js +529 -47
- package/dist/react.d.ts +22 -8
- package/dist/react.js +774 -311
- package/dist/tableColumns-BWoGh7tK.d.ts +30 -0
- package/package.json +5 -3
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Column order of the EXPLAIN table view. The row number column (`#`) always
|
|
3
|
+
* comes first and is not part of the order; every other column can be moved.
|
|
4
|
+
*/
|
|
5
|
+
declare const EXPLAIN_TABLE_COLUMNS: readonly ["operation", "relation", "cost", "estRows", "actualRows", "loops", "selfTime", "estimateGap", "filter"];
|
|
6
|
+
type ExplainTableColumnId = (typeof EXPLAIN_TABLE_COLUMNS)[number];
|
|
7
|
+
/** Columns that only hold values when the plan has ANALYZE data. */
|
|
8
|
+
declare const EXPLAIN_TABLE_ANALYZE_COLUMNS: ReadonlySet<ExplainTableColumnId>;
|
|
9
|
+
/**
|
|
10
|
+
* Turn a saved order into a complete one. Unknown ids and duplicates are
|
|
11
|
+
* dropped, and columns the saved order lacks (for example one added in a later
|
|
12
|
+
* version) are inserted after the column they follow by default, so an old
|
|
13
|
+
* saved order keeps working.
|
|
14
|
+
*/
|
|
15
|
+
declare function normalizeExplainTableColumnOrder(saved: unknown): ExplainTableColumnId[];
|
|
16
|
+
/**
|
|
17
|
+
* Move `column` to the place of `target`: to its left when moving left, to its
|
|
18
|
+
* right when moving right, the way a dragged column header lands. Returns the
|
|
19
|
+
* same array when nothing moves.
|
|
20
|
+
*/
|
|
21
|
+
declare function moveExplainTableColumn(order: readonly ExplainTableColumnId[], column: ExplainTableColumnId, target: ExplainTableColumnId): readonly ExplainTableColumnId[];
|
|
22
|
+
/**
|
|
23
|
+
* Move `column` one place to the left (-1) or right (1) among the columns that
|
|
24
|
+
* are shown, skipping hidden ones. Returns the same array at either end.
|
|
25
|
+
*/
|
|
26
|
+
declare function shiftExplainTableColumn(order: readonly ExplainTableColumnId[], column: ExplainTableColumnId, direction: -1 | 1, visible?: readonly ExplainTableColumnId[]): readonly ExplainTableColumnId[];
|
|
27
|
+
/** True when `order` is the default order. */
|
|
28
|
+
declare function isDefaultExplainTableColumnOrder(order: readonly ExplainTableColumnId[]): boolean;
|
|
29
|
+
|
|
30
|
+
export { EXPLAIN_TABLE_ANALYZE_COLUMNS as E, EXPLAIN_TABLE_COLUMNS as a, type ExplainTableColumnId as b, isDefaultExplainTableColumnOrder as i, moveExplainTableColumn as m, normalizeExplainTableColumnOrder as n, shiftExplainTableColumn as s };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tabularis/explain",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Parse, analyse and visualise a database EXPLAIN plan. Takes raw EXPLAIN output; never runs a query.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://github.com/TabularisDB/tabularis/tree/main/packages/explain",
|
|
@@ -83,12 +83,14 @@
|
|
|
83
83
|
"react": "^19.2.4",
|
|
84
84
|
"react-i18next": "^16.6.6",
|
|
85
85
|
"tsup": "^8.3.5",
|
|
86
|
-
"typescript": "~5.9.3"
|
|
86
|
+
"typescript": "~5.9.3",
|
|
87
|
+
"vitest": "^4.1.2"
|
|
87
88
|
},
|
|
88
89
|
"scripts": {
|
|
89
90
|
"build": "tsup",
|
|
90
91
|
"clean": "rm -rf dist",
|
|
91
|
-
"typecheck": "tsc --noEmit"
|
|
92
|
+
"typecheck": "tsc --noEmit",
|
|
93
|
+
"test": "vitest run"
|
|
92
94
|
},
|
|
93
95
|
"main": "./dist/index.js",
|
|
94
96
|
"types": "./dist/index.d.ts"
|