rawsql-ts 0.11.7-beta → 0.11.8-beta
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 +82 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.min.js +23 -15
- package/dist/esm/index.min.js.map +4 -4
- package/dist/esm/src/index.d.ts +1 -0
- package/dist/esm/src/index.js +1 -0
- package/dist/esm/src/index.js.map +1 -1
- package/dist/esm/src/models/BinarySelectQuery.d.ts +2 -2
- package/dist/esm/src/models/BinarySelectQuery.js.map +1 -1
- package/dist/esm/src/models/SelectQuery.d.ts +2 -1
- package/dist/esm/src/models/SelectQuery.js.map +1 -1
- package/dist/esm/src/models/SimpleSelectQuery.d.ts +2 -2
- package/dist/esm/src/models/SimpleSelectQuery.js.map +1 -1
- package/dist/esm/src/models/ValueComponent.d.ts +19 -4
- package/dist/esm/src/models/ValueComponent.js +19 -1
- package/dist/esm/src/models/ValueComponent.js.map +1 -1
- package/dist/esm/src/models/ValuesQuery.d.ts +2 -1
- package/dist/esm/src/models/ValuesQuery.js.map +1 -1
- package/dist/esm/src/parsers/CommonTableParser.js +16 -0
- package/dist/esm/src/parsers/CommonTableParser.js.map +1 -1
- package/dist/esm/src/parsers/LiteralParser.js +15 -5
- package/dist/esm/src/parsers/LiteralParser.js.map +1 -1
- package/dist/esm/src/parsers/SqlPrintTokenParser.d.ts +2 -0
- package/dist/esm/src/parsers/SqlPrintTokenParser.js +42 -2
- package/dist/esm/src/parsers/SqlPrintTokenParser.js.map +1 -1
- package/dist/esm/src/parsers/ValueParser.d.ts +13 -0
- package/dist/esm/src/parsers/ValueParser.js +134 -1
- package/dist/esm/src/parsers/ValueParser.js.map +1 -1
- package/dist/esm/src/parsers/WithClauseParser.js +8 -2
- package/dist/esm/src/parsers/WithClauseParser.js.map +1 -1
- package/dist/esm/src/reporting/models/DataFlowEdge.d.ts +33 -0
- package/dist/esm/src/reporting/models/DataFlowEdge.js +53 -0
- package/dist/esm/src/reporting/models/DataFlowEdge.js.map +1 -0
- package/dist/esm/src/reporting/models/DataFlowGraph.d.ts +49 -0
- package/dist/esm/src/reporting/models/DataFlowGraph.js +156 -0
- package/dist/esm/src/reporting/models/DataFlowGraph.js.map +1 -0
- package/dist/esm/src/reporting/models/DataFlowNode.d.ts +64 -0
- package/dist/esm/src/reporting/models/DataFlowNode.js +109 -0
- package/dist/esm/src/reporting/models/DataFlowNode.js.map +1 -0
- package/dist/esm/src/reporting/services/CTEHandler.d.ts +13 -0
- package/dist/esm/src/reporting/services/CTEHandler.js +27 -0
- package/dist/esm/src/reporting/services/CTEHandler.js.map +1 -0
- package/dist/esm/src/reporting/services/DataSourceHandler.d.ts +25 -0
- package/dist/esm/src/reporting/services/DataSourceHandler.js +91 -0
- package/dist/esm/src/reporting/services/DataSourceHandler.js.map +1 -0
- package/dist/esm/src/reporting/services/JoinHandler.d.ts +32 -0
- package/dist/esm/src/reporting/services/JoinHandler.js +80 -0
- package/dist/esm/src/reporting/services/JoinHandler.js.map +1 -0
- package/dist/esm/src/reporting/services/ProcessHandler.d.ts +55 -0
- package/dist/esm/src/reporting/services/ProcessHandler.js +177 -0
- package/dist/esm/src/reporting/services/ProcessHandler.js.map +1 -0
- package/dist/esm/src/tokenReaders/EscapedIdentifierTokenReader.d.ts +5 -0
- package/dist/esm/src/tokenReaders/EscapedIdentifierTokenReader.js +37 -1
- package/dist/esm/src/tokenReaders/EscapedIdentifierTokenReader.js.map +1 -1
- package/dist/esm/src/tokenReaders/LiteralTokenReader.d.ts +16 -0
- package/dist/esm/src/tokenReaders/LiteralTokenReader.js +119 -0
- package/dist/esm/src/tokenReaders/LiteralTokenReader.js.map +1 -1
- package/dist/esm/src/tokenReaders/OperatorTokenReader.js +4 -0
- package/dist/esm/src/tokenReaders/OperatorTokenReader.js.map +1 -1
- package/dist/esm/src/tokenReaders/ParameterTokenReader.d.ts +14 -0
- package/dist/esm/src/tokenReaders/ParameterTokenReader.js +126 -0
- package/dist/esm/src/tokenReaders/ParameterTokenReader.js.map +1 -1
- package/dist/esm/src/transformers/DynamicQueryBuilder.d.ts +28 -2
- package/dist/esm/src/transformers/DynamicQueryBuilder.js.map +1 -1
- package/dist/esm/src/transformers/QueryFlowDiagramGenerator.d.ts +37 -0
- package/dist/esm/src/transformers/QueryFlowDiagramGenerator.js +140 -0
- package/dist/esm/src/transformers/QueryFlowDiagramGenerator.js.map +1 -0
- package/dist/esm/src/transformers/SqlParamInjector.d.ts +11 -0
- package/dist/esm/src/transformers/SqlParamInjector.js.map +1 -1
- package/dist/esm/src/transformers/TypeTransformationPostProcessor.d.ts +5 -5
- package/dist/esm/src/transformers/TypeTransformationPostProcessor.js +20 -8
- package/dist/esm/src/transformers/TypeTransformationPostProcessor.js.map +1 -1
- package/dist/esm/src/utils/OperatorPrecedence.js +23 -1
- package/dist/esm/src/utils/OperatorPrecedence.js.map +1 -1
- package/dist/esm/src/utils/charLookupTable.js +4 -4
- package/dist/esm/src/utils/charLookupTable.js.map +1 -1
- package/dist/esm/src/utils/stringUtils.js +17 -1
- package/dist/esm/src/utils/stringUtils.js.map +1 -1
- package/dist/esm/tsconfig.browser.tsbuildinfo +1 -1
- package/dist/index.min.js +23 -15
- package/dist/index.min.js.map +4 -4
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +1 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/models/BinarySelectQuery.d.ts +2 -2
- package/dist/src/models/BinarySelectQuery.js.map +1 -1
- package/dist/src/models/SelectQuery.d.ts +2 -1
- package/dist/src/models/SelectQuery.js.map +1 -1
- package/dist/src/models/SimpleSelectQuery.d.ts +2 -2
- package/dist/src/models/SimpleSelectQuery.js.map +1 -1
- package/dist/src/models/ValueComponent.d.ts +19 -4
- package/dist/src/models/ValueComponent.js +22 -2
- package/dist/src/models/ValueComponent.js.map +1 -1
- package/dist/src/models/ValuesQuery.d.ts +2 -1
- package/dist/src/models/ValuesQuery.js.map +1 -1
- package/dist/src/parsers/CommonTableParser.js +16 -0
- package/dist/src/parsers/CommonTableParser.js.map +1 -1
- package/dist/src/parsers/LiteralParser.js +15 -5
- package/dist/src/parsers/LiteralParser.js.map +1 -1
- package/dist/src/parsers/SqlPrintTokenParser.d.ts +2 -0
- package/dist/src/parsers/SqlPrintTokenParser.js +41 -1
- package/dist/src/parsers/SqlPrintTokenParser.js.map +1 -1
- package/dist/src/parsers/ValueParser.d.ts +13 -0
- package/dist/src/parsers/ValueParser.js +133 -0
- package/dist/src/parsers/ValueParser.js.map +1 -1
- package/dist/src/parsers/WithClauseParser.js +8 -2
- package/dist/src/parsers/WithClauseParser.js.map +1 -1
- package/dist/src/reporting/models/DataFlowEdge.d.ts +33 -0
- package/dist/src/reporting/models/DataFlowEdge.js +58 -0
- package/dist/src/reporting/models/DataFlowEdge.js.map +1 -0
- package/dist/src/reporting/models/DataFlowGraph.d.ts +49 -0
- package/dist/src/reporting/models/DataFlowGraph.js +160 -0
- package/dist/src/reporting/models/DataFlowGraph.js.map +1 -0
- package/dist/src/reporting/models/DataFlowNode.d.ts +64 -0
- package/dist/src/reporting/models/DataFlowNode.js +117 -0
- package/dist/src/reporting/models/DataFlowNode.js.map +1 -0
- package/dist/src/reporting/services/CTEHandler.d.ts +13 -0
- package/dist/src/reporting/services/CTEHandler.js +31 -0
- package/dist/src/reporting/services/CTEHandler.js.map +1 -0
- package/dist/src/reporting/services/DataSourceHandler.d.ts +25 -0
- package/dist/src/reporting/services/DataSourceHandler.js +95 -0
- package/dist/src/reporting/services/DataSourceHandler.js.map +1 -0
- package/dist/src/reporting/services/JoinHandler.d.ts +32 -0
- package/dist/src/reporting/services/JoinHandler.js +84 -0
- package/dist/src/reporting/services/JoinHandler.js.map +1 -0
- package/dist/src/reporting/services/ProcessHandler.d.ts +55 -0
- package/dist/src/reporting/services/ProcessHandler.js +181 -0
- package/dist/src/reporting/services/ProcessHandler.js.map +1 -0
- package/dist/src/tokenReaders/EscapedIdentifierTokenReader.d.ts +5 -0
- package/dist/src/tokenReaders/EscapedIdentifierTokenReader.js +37 -1
- package/dist/src/tokenReaders/EscapedIdentifierTokenReader.js.map +1 -1
- package/dist/src/tokenReaders/LiteralTokenReader.d.ts +16 -0
- package/dist/src/tokenReaders/LiteralTokenReader.js +119 -0
- package/dist/src/tokenReaders/LiteralTokenReader.js.map +1 -1
- package/dist/src/tokenReaders/OperatorTokenReader.js +4 -0
- package/dist/src/tokenReaders/OperatorTokenReader.js.map +1 -1
- package/dist/src/tokenReaders/ParameterTokenReader.d.ts +14 -0
- package/dist/src/tokenReaders/ParameterTokenReader.js +126 -0
- package/dist/src/tokenReaders/ParameterTokenReader.js.map +1 -1
- package/dist/src/transformers/DynamicQueryBuilder.d.ts +28 -2
- package/dist/src/transformers/DynamicQueryBuilder.js.map +1 -1
- package/dist/src/transformers/QueryFlowDiagramGenerator.d.ts +37 -0
- package/dist/src/transformers/QueryFlowDiagramGenerator.js +144 -0
- package/dist/src/transformers/QueryFlowDiagramGenerator.js.map +1 -0
- package/dist/src/transformers/SqlParamInjector.d.ts +11 -0
- package/dist/src/transformers/SqlParamInjector.js.map +1 -1
- package/dist/src/transformers/TypeTransformationPostProcessor.d.ts +5 -5
- package/dist/src/transformers/TypeTransformationPostProcessor.js +20 -8
- package/dist/src/transformers/TypeTransformationPostProcessor.js.map +1 -1
- package/dist/src/utils/OperatorPrecedence.js +23 -1
- package/dist/src/utils/OperatorPrecedence.js.map +1 -1
- package/dist/src/utils/charLookupTable.js +4 -4
- package/dist/src/utils/charLookupTable.js.map +1 -1
- package/dist/src/utils/stringUtils.js +17 -1
- package/dist/src/utils/stringUtils.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DataFlowEdgeCollection = exports.DataFlowConnection = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Represents a connection between nodes in the data flow
|
|
6
|
+
*/
|
|
7
|
+
class DataFlowConnection {
|
|
8
|
+
constructor(from, to, label) {
|
|
9
|
+
this.from = from;
|
|
10
|
+
this.to = to;
|
|
11
|
+
this.label = label;
|
|
12
|
+
}
|
|
13
|
+
getMermaidRepresentation() {
|
|
14
|
+
const arrow = this.label ? ` -->|${this.label}| ` : ' --> ';
|
|
15
|
+
return `${this.from}${arrow}${this.to}`;
|
|
16
|
+
}
|
|
17
|
+
static create(from, to, label) {
|
|
18
|
+
return new DataFlowConnection(from, to, label);
|
|
19
|
+
}
|
|
20
|
+
static createWithNullability(from, to, isNullable) {
|
|
21
|
+
const label = isNullable ? 'NULLABLE' : 'NOT NULL';
|
|
22
|
+
return new DataFlowConnection(from, to, label);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.DataFlowConnection = DataFlowConnection;
|
|
26
|
+
/**
|
|
27
|
+
* Collection of edges with utilities for managing connections
|
|
28
|
+
*/
|
|
29
|
+
class DataFlowEdgeCollection {
|
|
30
|
+
constructor() {
|
|
31
|
+
this.edges = [];
|
|
32
|
+
this.connectionSet = new Set();
|
|
33
|
+
}
|
|
34
|
+
add(edge) {
|
|
35
|
+
const key = `${edge.from}->${edge.to}`;
|
|
36
|
+
if (!this.connectionSet.has(key)) {
|
|
37
|
+
this.edges.push(edge);
|
|
38
|
+
this.connectionSet.add(key);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
addConnection(from, to, label) {
|
|
42
|
+
this.add(DataFlowConnection.create(from, to, label));
|
|
43
|
+
}
|
|
44
|
+
addJoinConnection(from, to, isNullable) {
|
|
45
|
+
this.add(DataFlowConnection.createWithNullability(from, to, isNullable));
|
|
46
|
+
}
|
|
47
|
+
hasConnection(from, to) {
|
|
48
|
+
return this.connectionSet.has(`${from}->${to}`);
|
|
49
|
+
}
|
|
50
|
+
getAll() {
|
|
51
|
+
return [...this.edges];
|
|
52
|
+
}
|
|
53
|
+
getMermaidRepresentation() {
|
|
54
|
+
return this.edges.map(edge => edge.getMermaidRepresentation()).join('\n ');
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
exports.DataFlowEdgeCollection = DataFlowEdgeCollection;
|
|
58
|
+
//# sourceMappingURL=DataFlowEdge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataFlowEdge.js","sourceRoot":"","sources":["../../../../src/reporting/models/DataFlowEdge.ts"],"names":[],"mappings":";;;AASA;;GAEG;AACH,MAAa,kBAAkB;IAC3B,YACW,IAAY,EACZ,EAAU,EACV,KAAc;QAFd,SAAI,GAAJ,IAAI,CAAQ;QACZ,OAAE,GAAF,EAAE,CAAQ;QACV,UAAK,GAAL,KAAK,CAAS;IACtB,CAAC;IAEJ,wBAAwB;QACpB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,IAAI,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC;QAC5D,OAAO,GAAG,IAAI,CAAC,IAAI,GAAG,KAAK,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;IAC5C,CAAC;IAED,MAAM,CAAC,MAAM,CAAC,IAAY,EAAE,EAAU,EAAE,KAAc;QAClD,OAAO,IAAI,kBAAkB,CAAC,IAAI,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC;IACnD,CAAC;IAED,MAAM,CAAC,qBAAqB,CAAC,IAAY,EAAE,EAAU,EAAE,UAAmB;QACtE,MAAM,KAAK,GAAG,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC;QACnD,OAAO,IAAI,kBAAkB,CAAC,IAAI,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC;IACnD,CAAC;CACJ;AApBD,gDAoBC;AAED;;GAEG;AACH,MAAa,sBAAsB;IAAnC;QACY,UAAK,GAAyB,EAAE,CAAC;QACjC,kBAAa,GAAG,IAAI,GAAG,EAAU,CAAC;IA6B9C,CAAC;IA3BG,GAAG,CAAC,IAAwB;QACxB,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,EAAE,EAAE,CAAC;QACvC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;YAC/B,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACtB,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAChC,CAAC;IACL,CAAC;IAED,aAAa,CAAC,IAAY,EAAE,EAAU,EAAE,KAAc;QAClD,IAAI,CAAC,GAAG,CAAC,kBAAkB,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC;IACzD,CAAC;IAED,iBAAiB,CAAC,IAAY,EAAE,EAAU,EAAE,UAAmB;QAC3D,IAAI,CAAC,GAAG,CAAC,kBAAkB,CAAC,qBAAqB,CAAC,IAAI,EAAE,EAAE,EAAE,UAAU,CAAC,CAAC,CAAC;IAC7E,CAAC;IAED,aAAa,CAAC,IAAY,EAAE,EAAU;QAClC,OAAO,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,GAAG,IAAI,KAAK,EAAE,EAAE,CAAC,CAAC;IACpD,CAAC;IAED,MAAM;QACF,OAAO,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC;IAC3B,CAAC;IAED,wBAAwB;QACpB,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,wBAAwB,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAClF,CAAC;CACJ;AA/BD,wDA+BC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { BaseDataFlowNode, DataSourceNode, ProcessNode, OperationNode, OutputNode } from './DataFlowNode';
|
|
2
|
+
import { DataFlowConnection } from './DataFlowEdge';
|
|
3
|
+
/**
|
|
4
|
+
* Represents the complete data flow graph for a SQL query
|
|
5
|
+
*/
|
|
6
|
+
export declare class DataFlowGraph {
|
|
7
|
+
private nodes;
|
|
8
|
+
private edges;
|
|
9
|
+
addNode(node: BaseDataFlowNode): void;
|
|
10
|
+
addEdge(edge: DataFlowConnection): void;
|
|
11
|
+
addConnection(from: string, to: string, label?: string): void;
|
|
12
|
+
hasNode(nodeId: string): boolean;
|
|
13
|
+
hasConnection(from: string, to: string): boolean;
|
|
14
|
+
getNode(nodeId: string): BaseDataFlowNode | undefined;
|
|
15
|
+
getAllNodes(): BaseDataFlowNode[];
|
|
16
|
+
getAllEdges(): DataFlowConnection[];
|
|
17
|
+
/**
|
|
18
|
+
* Generates the complete Mermaid flowchart syntax
|
|
19
|
+
*/
|
|
20
|
+
generateMermaid(direction?: string, title?: string): string;
|
|
21
|
+
/**
|
|
22
|
+
* Creates or gets a table node
|
|
23
|
+
*/
|
|
24
|
+
getOrCreateTable(tableName: string): DataSourceNode;
|
|
25
|
+
/**
|
|
26
|
+
* Creates or gets a CTE node
|
|
27
|
+
*/
|
|
28
|
+
getOrCreateCTE(cteName: string): DataSourceNode;
|
|
29
|
+
/**
|
|
30
|
+
* Creates or gets a subquery node
|
|
31
|
+
*/
|
|
32
|
+
getOrCreateSubquery(alias: string): DataSourceNode;
|
|
33
|
+
/**
|
|
34
|
+
* Creates a process node
|
|
35
|
+
*/
|
|
36
|
+
createProcessNode(type: string, context: string): ProcessNode;
|
|
37
|
+
/**
|
|
38
|
+
* Creates a JOIN operation node
|
|
39
|
+
*/
|
|
40
|
+
createJoinNode(joinId: string, joinType: string): OperationNode;
|
|
41
|
+
/**
|
|
42
|
+
* Creates a set operation node (UNION, EXCEPT, etc.)
|
|
43
|
+
*/
|
|
44
|
+
createSetOperationNode(operationId: string, operation: string): OperationNode;
|
|
45
|
+
/**
|
|
46
|
+
* Creates an output node
|
|
47
|
+
*/
|
|
48
|
+
createOutputNode(context?: string): OutputNode;
|
|
49
|
+
}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DataFlowGraph = void 0;
|
|
4
|
+
const DataFlowNode_1 = require("./DataFlowNode");
|
|
5
|
+
const DataFlowEdge_1 = require("./DataFlowEdge");
|
|
6
|
+
/**
|
|
7
|
+
* Represents the complete data flow graph for a SQL query
|
|
8
|
+
*/
|
|
9
|
+
class DataFlowGraph {
|
|
10
|
+
constructor() {
|
|
11
|
+
this.nodes = new Map();
|
|
12
|
+
this.edges = new DataFlowEdge_1.DataFlowEdgeCollection();
|
|
13
|
+
}
|
|
14
|
+
addNode(node) {
|
|
15
|
+
this.nodes.set(node.id, node);
|
|
16
|
+
}
|
|
17
|
+
addEdge(edge) {
|
|
18
|
+
this.edges.add(edge);
|
|
19
|
+
}
|
|
20
|
+
addConnection(from, to, label) {
|
|
21
|
+
this.edges.addConnection(from, to, label);
|
|
22
|
+
}
|
|
23
|
+
hasNode(nodeId) {
|
|
24
|
+
return this.nodes.has(nodeId);
|
|
25
|
+
}
|
|
26
|
+
hasConnection(from, to) {
|
|
27
|
+
return this.edges.hasConnection(from, to);
|
|
28
|
+
}
|
|
29
|
+
getNode(nodeId) {
|
|
30
|
+
return this.nodes.get(nodeId);
|
|
31
|
+
}
|
|
32
|
+
getAllNodes() {
|
|
33
|
+
return Array.from(this.nodes.values());
|
|
34
|
+
}
|
|
35
|
+
getAllEdges() {
|
|
36
|
+
return this.edges.getAll();
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Generates the complete Mermaid flowchart syntax
|
|
40
|
+
*/
|
|
41
|
+
generateMermaid(direction = 'TD', title) {
|
|
42
|
+
let mermaid = `flowchart ${direction}\n`;
|
|
43
|
+
// Add title if provided
|
|
44
|
+
if (title) {
|
|
45
|
+
mermaid += ` %% ${title}\n`;
|
|
46
|
+
}
|
|
47
|
+
// Add nodes
|
|
48
|
+
const nodeLines = Array.from(this.nodes.values())
|
|
49
|
+
.map(node => ` ${node.getMermaidRepresentation()}`)
|
|
50
|
+
.join('\n');
|
|
51
|
+
if (nodeLines) {
|
|
52
|
+
mermaid += nodeLines + '\n';
|
|
53
|
+
}
|
|
54
|
+
// Add blank line between nodes and edges if both exist
|
|
55
|
+
if (this.nodes.size > 0 && this.edges.getAll().length > 0) {
|
|
56
|
+
mermaid += '\n';
|
|
57
|
+
}
|
|
58
|
+
// Add edges
|
|
59
|
+
const edgeRepresentation = this.edges.getMermaidRepresentation();
|
|
60
|
+
if (edgeRepresentation) {
|
|
61
|
+
mermaid += ` ${edgeRepresentation}\n`;
|
|
62
|
+
}
|
|
63
|
+
return mermaid;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Creates or gets a table node
|
|
67
|
+
*/
|
|
68
|
+
getOrCreateTable(tableName) {
|
|
69
|
+
const nodeId = `table_${tableName}`;
|
|
70
|
+
let node = this.nodes.get(nodeId);
|
|
71
|
+
if (!node) {
|
|
72
|
+
node = DataFlowNode_1.DataSourceNode.createTable(tableName);
|
|
73
|
+
this.addNode(node);
|
|
74
|
+
}
|
|
75
|
+
return node;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Creates or gets a CTE node
|
|
79
|
+
*/
|
|
80
|
+
getOrCreateCTE(cteName) {
|
|
81
|
+
const nodeId = `cte_${cteName}`;
|
|
82
|
+
let node = this.nodes.get(nodeId);
|
|
83
|
+
if (!node) {
|
|
84
|
+
node = DataFlowNode_1.DataSourceNode.createCTE(cteName);
|
|
85
|
+
this.addNode(node);
|
|
86
|
+
}
|
|
87
|
+
return node;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Creates or gets a subquery node
|
|
91
|
+
*/
|
|
92
|
+
getOrCreateSubquery(alias) {
|
|
93
|
+
const nodeId = `subquery_${alias}`;
|
|
94
|
+
let node = this.nodes.get(nodeId);
|
|
95
|
+
if (!node) {
|
|
96
|
+
node = DataFlowNode_1.DataSourceNode.createSubquery(alias);
|
|
97
|
+
this.addNode(node);
|
|
98
|
+
}
|
|
99
|
+
return node;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Creates a process node
|
|
103
|
+
*/
|
|
104
|
+
createProcessNode(type, context) {
|
|
105
|
+
let node;
|
|
106
|
+
switch (type.toLowerCase()) {
|
|
107
|
+
case 'where':
|
|
108
|
+
node = DataFlowNode_1.ProcessNode.createWhere(context);
|
|
109
|
+
break;
|
|
110
|
+
case 'group by':
|
|
111
|
+
node = DataFlowNode_1.ProcessNode.createGroupBy(context);
|
|
112
|
+
break;
|
|
113
|
+
case 'having':
|
|
114
|
+
node = DataFlowNode_1.ProcessNode.createHaving(context);
|
|
115
|
+
break;
|
|
116
|
+
case 'select':
|
|
117
|
+
node = DataFlowNode_1.ProcessNode.createSelect(context);
|
|
118
|
+
break;
|
|
119
|
+
case 'order by':
|
|
120
|
+
node = DataFlowNode_1.ProcessNode.createOrderBy(context);
|
|
121
|
+
break;
|
|
122
|
+
case 'limit':
|
|
123
|
+
node = DataFlowNode_1.ProcessNode.createLimit(context, false);
|
|
124
|
+
break;
|
|
125
|
+
case 'limit/offset':
|
|
126
|
+
node = DataFlowNode_1.ProcessNode.createLimit(context, true);
|
|
127
|
+
break;
|
|
128
|
+
default:
|
|
129
|
+
node = new DataFlowNode_1.ProcessNode(context, type);
|
|
130
|
+
}
|
|
131
|
+
this.addNode(node);
|
|
132
|
+
return node;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Creates a JOIN operation node
|
|
136
|
+
*/
|
|
137
|
+
createJoinNode(joinId, joinType) {
|
|
138
|
+
const node = DataFlowNode_1.OperationNode.createJoin(joinId, joinType);
|
|
139
|
+
this.addNode(node);
|
|
140
|
+
return node;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Creates a set operation node (UNION, EXCEPT, etc.)
|
|
144
|
+
*/
|
|
145
|
+
createSetOperationNode(operationId, operation) {
|
|
146
|
+
const node = DataFlowNode_1.OperationNode.createSetOperation(operationId, operation);
|
|
147
|
+
this.addNode(node);
|
|
148
|
+
return node;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Creates an output node
|
|
152
|
+
*/
|
|
153
|
+
createOutputNode(context = 'main') {
|
|
154
|
+
const node = new DataFlowNode_1.OutputNode(context);
|
|
155
|
+
this.addNode(node);
|
|
156
|
+
return node;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
exports.DataFlowGraph = DataFlowGraph;
|
|
160
|
+
//# sourceMappingURL=DataFlowGraph.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataFlowGraph.js","sourceRoot":"","sources":["../../../../src/reporting/models/DataFlowGraph.ts"],"names":[],"mappings":";;;AAAA,iDAA0G;AAC1G,iDAA4E;AAE5E;;GAEG;AACH,MAAa,aAAa;IAA1B;QACY,UAAK,GAAG,IAAI,GAAG,EAA4B,CAAC;QAC5C,UAAK,GAAG,IAAI,qCAAsB,EAAE,CAAC;IA+KjD,CAAC;IA7KG,OAAO,CAAC,IAAsB;QAC1B,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;IAClC,CAAC;IAED,OAAO,CAAC,IAAwB;QAC5B,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACzB,CAAC;IAED,aAAa,CAAC,IAAY,EAAE,EAAU,EAAE,KAAc;QAClD,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC;IAC9C,CAAC;IAED,OAAO,CAAC,MAAc;QAClB,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAClC,CAAC;IAED,aAAa,CAAC,IAAY,EAAE,EAAU;QAClC,OAAO,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,EAAE,EAAE,CAAC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EG;IACH,gBAAgB,CAAC,UAAkB,MAAM;QACrC,MAAM,IAAI,GAAG,IAAI,yBAAU,CAAC,OAAO,CAAC,CAAC;QACrC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACnB,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAjLD,sCAiLC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents a node in the SQL data flow diagram
|
|
3
|
+
*/
|
|
4
|
+
export interface DataFlowNode {
|
|
5
|
+
id: string;
|
|
6
|
+
label: string;
|
|
7
|
+
type: NodeType;
|
|
8
|
+
shape: NodeShape;
|
|
9
|
+
details?: string[];
|
|
10
|
+
}
|
|
11
|
+
export type NodeType = 'table' | 'cte' | 'subquery' | 'process' | 'operation' | 'output';
|
|
12
|
+
export type NodeShape = 'cylinder' | 'hexagon' | 'diamond' | 'rounded' | 'rectangle' | 'circle';
|
|
13
|
+
/**
|
|
14
|
+
* Base class for all data flow nodes
|
|
15
|
+
*/
|
|
16
|
+
export declare abstract class BaseDataFlowNode implements DataFlowNode {
|
|
17
|
+
id: string;
|
|
18
|
+
label: string;
|
|
19
|
+
type: NodeType;
|
|
20
|
+
shape: NodeShape;
|
|
21
|
+
details?: string[] | undefined;
|
|
22
|
+
constructor(id: string, label: string, type: NodeType, shape: NodeShape, details?: string[] | undefined);
|
|
23
|
+
abstract getMermaidRepresentation(): string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Represents a data source (table, CTE, subquery)
|
|
27
|
+
*/
|
|
28
|
+
export declare class DataSourceNode extends BaseDataFlowNode {
|
|
29
|
+
constructor(id: string, label: string, type: 'table' | 'cte' | 'subquery');
|
|
30
|
+
getMermaidRepresentation(): string;
|
|
31
|
+
static createTable(tableName: string): DataSourceNode;
|
|
32
|
+
static createCTE(cteName: string): DataSourceNode;
|
|
33
|
+
static createSubquery(alias: string): DataSourceNode;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Represents a processing operation (WHERE, GROUP BY, SELECT, etc.)
|
|
37
|
+
*/
|
|
38
|
+
export declare class ProcessNode extends BaseDataFlowNode {
|
|
39
|
+
constructor(id: string, operation: string, context?: string);
|
|
40
|
+
getMermaidRepresentation(): string;
|
|
41
|
+
static createWhere(context: string): ProcessNode;
|
|
42
|
+
static createGroupBy(context: string): ProcessNode;
|
|
43
|
+
static createHaving(context: string): ProcessNode;
|
|
44
|
+
static createSelect(context: string): ProcessNode;
|
|
45
|
+
static createOrderBy(context: string): ProcessNode;
|
|
46
|
+
static createLimit(context: string, hasOffset?: boolean): ProcessNode;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Represents an operation (JOIN, UNION, etc.)
|
|
50
|
+
*/
|
|
51
|
+
export declare class OperationNode extends BaseDataFlowNode {
|
|
52
|
+
constructor(id: string, operation: string);
|
|
53
|
+
getMermaidRepresentation(): string;
|
|
54
|
+
static createJoin(joinId: string, joinType: string): OperationNode;
|
|
55
|
+
static createUnion(unionId: string, unionType?: string): OperationNode;
|
|
56
|
+
static createSetOperation(operationId: string, operation: string): OperationNode;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Represents the final output
|
|
60
|
+
*/
|
|
61
|
+
export declare class OutputNode extends BaseDataFlowNode {
|
|
62
|
+
constructor(context?: string);
|
|
63
|
+
getMermaidRepresentation(): string;
|
|
64
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OutputNode = exports.OperationNode = exports.ProcessNode = exports.DataSourceNode = exports.BaseDataFlowNode = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Base class for all data flow nodes
|
|
6
|
+
*/
|
|
7
|
+
class BaseDataFlowNode {
|
|
8
|
+
constructor(id, label, type, shape, details) {
|
|
9
|
+
this.id = id;
|
|
10
|
+
this.label = label;
|
|
11
|
+
this.type = type;
|
|
12
|
+
this.shape = shape;
|
|
13
|
+
this.details = details;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.BaseDataFlowNode = BaseDataFlowNode;
|
|
17
|
+
/**
|
|
18
|
+
* Represents a data source (table, CTE, subquery)
|
|
19
|
+
*/
|
|
20
|
+
class DataSourceNode extends BaseDataFlowNode {
|
|
21
|
+
constructor(id, label, type) {
|
|
22
|
+
super(id, label, type, 'cylinder');
|
|
23
|
+
}
|
|
24
|
+
getMermaidRepresentation() {
|
|
25
|
+
return `${this.id}[(${this.label})]`;
|
|
26
|
+
}
|
|
27
|
+
static createTable(tableName) {
|
|
28
|
+
return new DataSourceNode(`table_${tableName}`, tableName, 'table');
|
|
29
|
+
}
|
|
30
|
+
static createCTE(cteName) {
|
|
31
|
+
return new DataSourceNode(`cte_${cteName}`, `CTE:${cteName}`, 'cte');
|
|
32
|
+
}
|
|
33
|
+
static createSubquery(alias) {
|
|
34
|
+
return new DataSourceNode(`subquery_${alias}`, `QUERY:${alias}`, 'subquery');
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
exports.DataSourceNode = DataSourceNode;
|
|
38
|
+
/**
|
|
39
|
+
* Represents a processing operation (WHERE, GROUP BY, SELECT, etc.)
|
|
40
|
+
*/
|
|
41
|
+
class ProcessNode extends BaseDataFlowNode {
|
|
42
|
+
constructor(id, operation, context = '') {
|
|
43
|
+
const nodeId = context ? `${context}_${operation.toLowerCase().replace(/\s+/g, '_')}` : operation.toLowerCase().replace(/\s+/g, '_');
|
|
44
|
+
super(nodeId, operation, 'process', 'hexagon');
|
|
45
|
+
}
|
|
46
|
+
getMermaidRepresentation() {
|
|
47
|
+
return `${this.id}{{${this.label}}}`;
|
|
48
|
+
}
|
|
49
|
+
static createWhere(context) {
|
|
50
|
+
return new ProcessNode(`${context}_where`, 'WHERE', context);
|
|
51
|
+
}
|
|
52
|
+
static createGroupBy(context) {
|
|
53
|
+
return new ProcessNode(`${context}_group_by`, 'GROUP BY', context);
|
|
54
|
+
}
|
|
55
|
+
static createHaving(context) {
|
|
56
|
+
return new ProcessNode(`${context}_having`, 'HAVING', context);
|
|
57
|
+
}
|
|
58
|
+
static createSelect(context) {
|
|
59
|
+
return new ProcessNode(`${context}_select`, 'SELECT', context);
|
|
60
|
+
}
|
|
61
|
+
static createOrderBy(context) {
|
|
62
|
+
return new ProcessNode(`${context}_order_by`, 'ORDER BY', context);
|
|
63
|
+
}
|
|
64
|
+
static createLimit(context, hasOffset = false) {
|
|
65
|
+
const label = hasOffset ? 'LIMIT/OFFSET' : 'LIMIT';
|
|
66
|
+
return new ProcessNode(`${context}_limit`, label, context);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
exports.ProcessNode = ProcessNode;
|
|
70
|
+
/**
|
|
71
|
+
* Represents an operation (JOIN, UNION, etc.)
|
|
72
|
+
*/
|
|
73
|
+
class OperationNode extends BaseDataFlowNode {
|
|
74
|
+
constructor(id, operation) {
|
|
75
|
+
super(id, operation, 'operation', 'diamond');
|
|
76
|
+
}
|
|
77
|
+
getMermaidRepresentation() {
|
|
78
|
+
return `${this.id}{${this.label}}`;
|
|
79
|
+
}
|
|
80
|
+
static createJoin(joinId, joinType) {
|
|
81
|
+
let label;
|
|
82
|
+
const normalizedType = joinType.trim().toLowerCase();
|
|
83
|
+
if (normalizedType === 'join') {
|
|
84
|
+
label = 'INNER JOIN';
|
|
85
|
+
}
|
|
86
|
+
else if (normalizedType.endsWith(' join')) {
|
|
87
|
+
label = normalizedType.toUpperCase();
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
label = normalizedType.toUpperCase() + ' JOIN';
|
|
91
|
+
}
|
|
92
|
+
return new OperationNode(`join_${joinId}`, label);
|
|
93
|
+
}
|
|
94
|
+
static createUnion(unionId, unionType = 'UNION ALL') {
|
|
95
|
+
return new OperationNode(`${unionType.toLowerCase().replace(/\s+/g, '_')}_${unionId}`, unionType.toUpperCase());
|
|
96
|
+
}
|
|
97
|
+
static createSetOperation(operationId, operation) {
|
|
98
|
+
const normalizedOp = operation.toUpperCase();
|
|
99
|
+
const id = `${normalizedOp.toLowerCase().replace(/\s+/g, '_')}_${operationId}`;
|
|
100
|
+
return new OperationNode(id, normalizedOp);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
exports.OperationNode = OperationNode;
|
|
104
|
+
/**
|
|
105
|
+
* Represents the final output
|
|
106
|
+
*/
|
|
107
|
+
class OutputNode extends BaseDataFlowNode {
|
|
108
|
+
constructor(context = 'main') {
|
|
109
|
+
const label = context === 'main' ? 'Final Result' : `${context} Result`;
|
|
110
|
+
super(`${context}_output`, label, 'output', 'rounded');
|
|
111
|
+
}
|
|
112
|
+
getMermaidRepresentation() {
|
|
113
|
+
return `${this.id}(${this.label})`;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
exports.OutputNode = OutputNode;
|
|
117
|
+
//# sourceMappingURL=DataFlowNode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataFlowNode.js","sourceRoot":"","sources":["../../../../src/reporting/models/DataFlowNode.ts"],"names":[],"mappings":";;;AAeA;;GAEG;AACH,MAAsB,gBAAgB;IAClC,YACW,EAAU,EACV,KAAa,EACb,IAAc,EACd,KAAgB,EAChB,OAAkB;QAJlB,OAAE,GAAF,EAAE,CAAQ;QACV,UAAK,GAAL,KAAK,CAAQ;QACb,SAAI,GAAJ,IAAI,CAAU;QACd,UAAK,GAAL,KAAK,CAAW;QAChB,YAAO,GAAP,OAAO,CAAW;IAC1B,CAAC;CAGP;AAVD,4CAUC;AAED;;GAEG;AACH,MAAa,cAAe,SAAQ,gBAAgB;IAChD,YAAY,EAAU,EAAE,KAAa,EAAE,IAAkC;QACrE,KAAK,CAAC,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,CAAC,CAAC;IACvC,CAAC;IAED,wBAAwB;QACpB,OAAO,GAAG,IAAI,CAAC,EAAE,KAAK,IAAI,CAAC,KAAK,IAAI,CAAC;I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raph } from '../models/DataFlowGraph';
|
|
3
|
+
/**
|
|
4
|
+
* Handles the processing of Common Table Expressions (CTEs)
|
|
5
|
+
*/
|
|
6
|
+
export declare class CTEHandler {
|
|
7
|
+
private graph;
|
|
8
|
+
constructor(graph: DataFlowGraph);
|
|
9
|
+
/**
|
|
10
|
+
* Processes all CTEs in a WITH clause
|
|
11
|
+
*/
|
|
12
|
+
processCTEs(withClause: WithClause, cteNames: Set<string>, queryProcessor: (query: any, context: string, cteNames: Set<string>) => string): void;
|
|
13
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CTEHandler = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Handles the processing of Common Table Expressions (CTEs)
|
|
6
|
+
*/
|
|
7
|
+
class CTEHandler {
|
|
8
|
+
constructor(graph) {
|
|
9
|
+
this.graph = graph;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Processes all CTEs in a WITH clause
|
|
13
|
+
*/
|
|
14
|
+
processCTEs(withClause, cteNames, queryProcessor) {
|
|
15
|
+
for (const cte of withClause.tables) {
|
|
16
|
+
const cteName = cte.getSourceAliasName();
|
|
17
|
+
// Create virtual data source node for CTE
|
|
18
|
+
const cteNode = this.graph.getOrCreateCTE(cteName);
|
|
19
|
+
// Track CTE name
|
|
20
|
+
cteNames.add(cteName);
|
|
21
|
+
// Process CTE query and connect its result to the CTE virtual data source
|
|
22
|
+
const cteResultId = queryProcessor(cte.query, `cte_${cteName}`, cteNames);
|
|
23
|
+
// Connect CTE query result to CTE virtual data source
|
|
24
|
+
if (cteResultId && !this.graph.hasConnection(cteResultId, cteNode.id)) {
|
|
25
|
+
this.graph.addConnection(cteResultId, cteNode.id);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.CTEHandler = CTEHandler;
|
|
31
|
+
//# sourceMappingURL=CTEHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CTEHandler.js","sourceRoot":"","sources":["../../../../src/reporting/services/CTEHandler.ts"],"names":[],"mappings":";;;AAIA;;GAEG;AACH,MAAa,UAAU;IACnB,YAAoB,KAAoB;QAApB,UAAK,GAAL,KAAK,CAAe;IAAG,CAAC;IAE5C;;OAEG;IACH,WAAW,CACP,UAAsB,EACtB,QAAqB,EACrB,cAA8E;QAE9E,KAAK,MAAM,GAAG,IAAI,UAAU,CAAC,MAAM,EAAE,CAAC;YAClC,MAAM,OAAO,GAAG,GAAG,CAAC,kBAAkB,EAAE,CAAC;YAEzC,0CAA0C;YAC1C,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;YAEnD,iBAAiB;YACjB,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;YAEtB,0EAA0E;YAC1E,MAAM,WAAW,GAAG,cAAc,CAAC,GAAG,CAAC,KAAK,EAAE,OAAO,OAAO,EAAE,EAAE,QAAQ,CAAC,CAAC;YAE1E,sDAAsD;YACtD,IAAI,WAAW,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,WAAW,EAAE,OAAO,CAAC,EAAE,CAAC,EAAE,CAAC;gBACpE,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,WAAW,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC;YACtD,CAAC;QACL,CAAC;IACL,CAAC;CACJ;AA7BD,gCA6BC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { SourceExpression } from '../../models/Clause';
|
|
2
|
+
import { DataFlowGraph } from '../models/DataFlowGraph';
|
|
3
|
+
/**
|
|
4
|
+
* Handles the processing of data sources (tables, CTEs, subqueries)
|
|
5
|
+
*/
|
|
6
|
+
export declare class DataSourceHandler {
|
|
7
|
+
private graph;
|
|
8
|
+
constructor(graph: DataFlowGraph);
|
|
9
|
+
/**
|
|
10
|
+
* Processes a source expression and returns the node ID
|
|
11
|
+
*/
|
|
12
|
+
processSource(sourceExpr: SourceExpression, cteNames: Set<string>, queryProcessor: (query: any, context: string, cteNames: Set<string>) => string): string;
|
|
13
|
+
/**
|
|
14
|
+
* Processes a table source (including CTE references)
|
|
15
|
+
*/
|
|
16
|
+
private processTableSource;
|
|
17
|
+
/**
|
|
18
|
+
* Processes a subquery source
|
|
19
|
+
*/
|
|
20
|
+
private processSubquerySource;
|
|
21
|
+
/**
|
|
22
|
+
* Extracts table node IDs from a FROM clause for WHERE subqueries
|
|
23
|
+
*/
|
|
24
|
+
extractTableNodeIds(fromClause: any, cteNames: Set<string>): string[];
|
|
25
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DataSourceHandler = void 0;
|
|
4
|
+
const Clause_1 = require("../../models/Clause");
|
|
5
|
+
/**
|
|
6
|
+
* Handles the processing of data sources (tables, CTEs, subqueries)
|
|
7
|
+
*/
|
|
8
|
+
class DataSourceHandler {
|
|
9
|
+
constructor(graph) {
|
|
10
|
+
this.graph = graph;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Processes a source expression and returns the node ID
|
|
14
|
+
*/
|
|
15
|
+
processSource(sourceExpr, cteNames, queryProcessor) {
|
|
16
|
+
if (sourceExpr.datasource instanceof Clause_1.TableSource) {
|
|
17
|
+
return this.processTableSource(sourceExpr.datasource, cteNames);
|
|
18
|
+
}
|
|
19
|
+
else if (sourceExpr.datasource instanceof Clause_1.SubQuerySource) {
|
|
20
|
+
return this.processSubquerySource(sourceExpr, cteNames, queryProcessor);
|
|
21
|
+
}
|
|
22
|
+
throw new Error('Unsupported source type');
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Processes a table source (including CTE references)
|
|
26
|
+
*/
|
|
27
|
+
processTableSource(tableSource, cteNames) {
|
|
28
|
+
const tableName = tableSource.getSourceName();
|
|
29
|
+
if (cteNames.has(tableName)) {
|
|
30
|
+
// Reference to existing CTE
|
|
31
|
+
const cteNode = this.graph.getOrCreateCTE(tableName);
|
|
32
|
+
return cteNode.id;
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
// Regular table
|
|
36
|
+
const tableNode = this.graph.getOrCreateTable(tableName);
|
|
37
|
+
return tableNode.id;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Processes a subquery source
|
|
42
|
+
*/
|
|
43
|
+
processSubquerySource(sourceExpr, cteNames, queryProcessor) {
|
|
44
|
+
var _a;
|
|
45
|
+
const alias = ((_a = sourceExpr.aliasExpression) === null || _a === void 0 ? void 0 : _a.table.name) || 'subquery';
|
|
46
|
+
// Create virtual data source node for named subquery
|
|
47
|
+
const subqueryNode = this.graph.getOrCreateSubquery(alias);
|
|
48
|
+
// Process subquery content and connect its result to the subquery virtual data source
|
|
49
|
+
const subqueryResultId = queryProcessor(sourceExpr.datasource.query, `subquery_${alias}_internal`, cteNames);
|
|
50
|
+
// Connect subquery result to subquery virtual data source
|
|
51
|
+
if (subqueryResultId && !this.graph.hasConnection(subqueryResultId, subqueryNode.id)) {
|
|
52
|
+
this.graph.addConnection(subqueryResultId, subqueryNode.id);
|
|
53
|
+
}
|
|
54
|
+
return subqueryNode.id;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Extracts table node IDs from a FROM clause for WHERE subqueries
|
|
58
|
+
*/
|
|
59
|
+
extractTableNodeIds(fromClause, cteNames) {
|
|
60
|
+
const tableNodeIds = [];
|
|
61
|
+
const sourceExpr = fromClause.source;
|
|
62
|
+
// Process main source
|
|
63
|
+
if (sourceExpr.datasource instanceof Clause_1.TableSource) {
|
|
64
|
+
const tableName = sourceExpr.datasource.getSourceName();
|
|
65
|
+
if (cteNames.has(tableName)) {
|
|
66
|
+
const cteNode = this.graph.getOrCreateCTE(tableName);
|
|
67
|
+
tableNodeIds.push(cteNode.id);
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
const tableNode = this.graph.getOrCreateTable(tableName);
|
|
71
|
+
tableNodeIds.push(tableNode.id);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
// Process JOINs
|
|
75
|
+
if (fromClause.joins && fromClause.joins.length > 0) {
|
|
76
|
+
for (const join of fromClause.joins) {
|
|
77
|
+
const joinSourceExpr = join.source;
|
|
78
|
+
if (joinSourceExpr.datasource instanceof Clause_1.TableSource) {
|
|
79
|
+
const tableName = joinSourceExpr.datasource.getSourceName();
|
|
80
|
+
if (cteNames.has(tableName)) {
|
|
81
|
+
const cteNode = this.graph.getOrCreateCTE(tableName);
|
|
82
|
+
tableNodeIds.push(cteNode.id);
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
const tableNode = this.graph.getOrCreateTable(tableName);
|
|
86
|
+
tableNodeIds.push(tableNode.id);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
return tableNodeIds;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
exports.DataSourceHandler = DataSourceHandler;
|
|
95
|
+
//# sourceMappingURL=DataSourceHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataSourceHandler.js","sourceRoot":"","sources":["../../../../src/reporting/services/DataSourceHandler.ts"],"names":[],"mappings":";;;AAAA,gDAAkE;AAKlE;;GAEG;AACH,MAAa,iBAAiB;IAC1B,YAAoB,KAAoB;QAApB,UAAK,GAAL,KAAK,CAAe;IAAG,CAAC;IAE5C;;OAEG;IACH,aAAa,CACT,UAA4B,EAC5B,QAAqB,EACrB,cAA8E;QAE9E,IAAI,UAAU,CAAC,UAAU,YAAY,oBAAW,EAAE,CAAC;YAC/C,OAAO,IAAI,CAAC,kBAAkB,CAAC,UAAU,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;QACpE,CAAC;aAAM,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