@memberjunction/sqlglot-ts 5.41.0 → 5.43.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/MJPostgresTranspiler.d.ts +66 -0
- package/dist/MJPostgresTranspiler.d.ts.map +1 -0
- package/dist/MJPostgresTranspiler.js +126 -0
- package/dist/MJPostgresTranspiler.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/python/mj_postgres.py +1571 -0
- package/src/python/test_mj_postgres.py +573 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/** One statement the MJ dialect refused to emit — a reported conversion gap. */
|
|
2
|
+
export interface MJUnhandledStatement {
|
|
3
|
+
/** What the dialect saw (e.g. 'Command', 'Declare'). */
|
|
4
|
+
kind: string;
|
|
5
|
+
/** The offending T-SQL (possibly truncated by the dialect). */
|
|
6
|
+
snippet: string;
|
|
7
|
+
}
|
|
8
|
+
/** Result of transpiling MemberJunction T-SQL to PostgreSQL via the MJ dialect. */
|
|
9
|
+
export interface MJPostgresTranspileResult {
|
|
10
|
+
/** The emitted PostgreSQL statements, in order. */
|
|
11
|
+
sql: string[];
|
|
12
|
+
/** Statements the dialect refused to emit — never silently dropped. */
|
|
13
|
+
unhandled: MJUnhandledStatement[];
|
|
14
|
+
}
|
|
15
|
+
export interface MJPostgresTranspilerOptions {
|
|
16
|
+
/**
|
|
17
|
+
* Python interpreter to run the dialect with. Resolution order:
|
|
18
|
+
* this option → `MJ_SQLGLOT_PYTHON` env var → `python3` on PATH.
|
|
19
|
+
* The interpreter must have `sqlglot` installed (`pip install sqlglot`).
|
|
20
|
+
*/
|
|
21
|
+
pythonPath?: string;
|
|
22
|
+
/**
|
|
23
|
+
* BIT/BOOLEAN columns declared OUTSIDE the SQL being transpiled (cross-file
|
|
24
|
+
* registry, e.g. collected from the baselines), so seed INSERTs targeting those
|
|
25
|
+
* tables get their 1/0 values coerced to TRUE/FALSE.
|
|
26
|
+
*/
|
|
27
|
+
extraBitColumns?: string[];
|
|
28
|
+
/** Per-invocation timeout in ms (default 120000 — baselines are large). */
|
|
29
|
+
timeoutMs?: number;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* One-shot transpiler for MemberJunction T-SQL → PostgreSQL via the MJ sqlglot
|
|
33
|
+
* dialect (`mj_postgres.py`). Unlike `SqlGlotClient` (a long-lived FastAPI
|
|
34
|
+
* microservice for generic dialect conversion), this invokes the dialect script
|
|
35
|
+
* directly per call — deterministic, no server lifecycle, suited to CLI batch
|
|
36
|
+
* conversion where each migration is transpiled exactly once.
|
|
37
|
+
*
|
|
38
|
+
* The dialect's contract: every input statement is either emitted as PostgreSQL
|
|
39
|
+
* or reported in `unhandled` — never silently dropped.
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```ts
|
|
43
|
+
* const transpiler = new MJPostgresTranspiler({ extraBitColumns: bitCols });
|
|
44
|
+
* const result = await transpiler.transpile(keptTsql);
|
|
45
|
+
* // result.sql → PG statements; result.unhandled → gaps to surface
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
export declare class MJPostgresTranspiler {
|
|
49
|
+
private readonly pythonPath;
|
|
50
|
+
private readonly dialectPath;
|
|
51
|
+
private readonly extraBitColumns;
|
|
52
|
+
private readonly timeoutMs;
|
|
53
|
+
constructor(options?: MJPostgresTranspilerOptions);
|
|
54
|
+
/** Transpile T-SQL to PostgreSQL. Statements the dialect can't emit land in `unhandled`. */
|
|
55
|
+
transpile(tsql: string): Promise<MJPostgresTranspileResult>;
|
|
56
|
+
/**
|
|
57
|
+
* Collect the BIT/BOOLEAN column registry (`Table.Column` pairs) declared in the
|
|
58
|
+
* given SQL — used to build the cross-file registry from baselines before
|
|
59
|
+
* transpiling individual migrations.
|
|
60
|
+
*/
|
|
61
|
+
collectBitColumns(sql: string): Promise<string[]>;
|
|
62
|
+
/** Verify the interpreter + sqlglot are available; throws with install guidance if not. */
|
|
63
|
+
preflight(): Promise<void>;
|
|
64
|
+
private runDialect;
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=MJPostgresTranspiler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MJPostgresTranspiler.d.ts","sourceRoot":"","sources":["../src/MJPostgresTranspiler.ts"],"names":[],"mappings":"AAQA,gFAAgF;AAChF,MAAM,WAAW,oBAAoB;IACnC,wDAAwD;IACxD,IAAI,EAAE,MAAM,CAAC;IACb,+DAA+D;IAC/D,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,mFAAmF;AACnF,MAAM,WAAW,yBAAyB;IACxC,mDAAmD;IACnD,GAAG,EAAE,MAAM,EAAE,CAAC;IACd,uEAAuE;IACvE,SAAS,EAAE,oBAAoB,EAAE,CAAC;CACnC;AAED,MAAM,WAAW,2BAA2B;IAC1C;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,2EAA2E;IAC3E,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAkBD;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAS;IACpC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAS;IACrC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAW;IAC3C,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;gBAEvB,OAAO,CAAC,EAAE,2BAA2B;IAOjD,4FAA4F;IACtF,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,yBAAyB,CAAC;IASjE;;;;OAIG;IACG,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IASvD,2FAA2F;IACrF,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;IAIhC,OAAO,CAAC,UAAU;CAoEnB"}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { spawn } from 'node:child_process';
|
|
2
|
+
import { existsSync } from 'node:fs';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import { fileURLToPath } from 'node:url';
|
|
5
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = path.dirname(__filename);
|
|
7
|
+
/**
|
|
8
|
+
* Resolve the MJ dialect script path.
|
|
9
|
+
* When running from dist/ the path is ../src/python/mj_postgres.py
|
|
10
|
+
* When running from src/ (e.g. vitest) the path is ./python/mj_postgres.py
|
|
11
|
+
*/
|
|
12
|
+
function resolveDialectPath() {
|
|
13
|
+
const candidates = [
|
|
14
|
+
path.resolve(__dirname, '..', 'src', 'python', 'mj_postgres.py'), // from dist/
|
|
15
|
+
path.resolve(__dirname, 'python', 'mj_postgres.py'), // from src/ (vitest)
|
|
16
|
+
];
|
|
17
|
+
for (const candidate of candidates) {
|
|
18
|
+
if (existsSync(candidate))
|
|
19
|
+
return candidate;
|
|
20
|
+
}
|
|
21
|
+
return candidates[0]; // fail at spawn time with a clear error
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* One-shot transpiler for MemberJunction T-SQL → PostgreSQL via the MJ sqlglot
|
|
25
|
+
* dialect (`mj_postgres.py`). Unlike `SqlGlotClient` (a long-lived FastAPI
|
|
26
|
+
* microservice for generic dialect conversion), this invokes the dialect script
|
|
27
|
+
* directly per call — deterministic, no server lifecycle, suited to CLI batch
|
|
28
|
+
* conversion where each migration is transpiled exactly once.
|
|
29
|
+
*
|
|
30
|
+
* The dialect's contract: every input statement is either emitted as PostgreSQL
|
|
31
|
+
* or reported in `unhandled` — never silently dropped.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```ts
|
|
35
|
+
* const transpiler = new MJPostgresTranspiler({ extraBitColumns: bitCols });
|
|
36
|
+
* const result = await transpiler.transpile(keptTsql);
|
|
37
|
+
* // result.sql → PG statements; result.unhandled → gaps to surface
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
export class MJPostgresTranspiler {
|
|
41
|
+
constructor(options) {
|
|
42
|
+
this.pythonPath = options?.pythonPath ?? process.env.MJ_SQLGLOT_PYTHON ?? 'python3';
|
|
43
|
+
this.dialectPath = resolveDialectPath();
|
|
44
|
+
this.extraBitColumns = options?.extraBitColumns ?? [];
|
|
45
|
+
this.timeoutMs = options?.timeoutMs ?? 120_000;
|
|
46
|
+
}
|
|
47
|
+
/** Transpile T-SQL to PostgreSQL. Statements the dialect can't emit land in `unhandled`. */
|
|
48
|
+
async transpile(tsql) {
|
|
49
|
+
const stdout = await this.runDialect([], tsql);
|
|
50
|
+
const parsed = JSON.parse(stdout);
|
|
51
|
+
if (!Array.isArray(parsed.sql) || !Array.isArray(parsed.unhandled)) {
|
|
52
|
+
throw new Error(`MJPostgresTranspiler: unexpected dialect output shape: ${stdout.slice(0, 200)}`);
|
|
53
|
+
}
|
|
54
|
+
return parsed;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Collect the BIT/BOOLEAN column registry (`Table.Column` pairs) declared in the
|
|
58
|
+
* given SQL — used to build the cross-file registry from baselines before
|
|
59
|
+
* transpiling individual migrations.
|
|
60
|
+
*/
|
|
61
|
+
async collectBitColumns(sql) {
|
|
62
|
+
const stdout = await this.runDialect(['--collect-bitcols'], sql);
|
|
63
|
+
const parsed = JSON.parse(stdout);
|
|
64
|
+
if (!Array.isArray(parsed)) {
|
|
65
|
+
throw new Error(`MJPostgresTranspiler: unexpected --collect-bitcols output: ${stdout.slice(0, 200)}`);
|
|
66
|
+
}
|
|
67
|
+
return parsed;
|
|
68
|
+
}
|
|
69
|
+
/** Verify the interpreter + sqlglot are available; throws with install guidance if not. */
|
|
70
|
+
async preflight() {
|
|
71
|
+
await this.runDialect([], 'SELECT 1;');
|
|
72
|
+
}
|
|
73
|
+
runDialect(args, stdin) {
|
|
74
|
+
return new Promise((resolve, reject) => {
|
|
75
|
+
const proc = spawn(this.pythonPath, [this.dialectPath, ...args], {
|
|
76
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
77
|
+
env: {
|
|
78
|
+
...process.env,
|
|
79
|
+
MJ_EXTRA_BIT_COLS: JSON.stringify(this.extraBitColumns),
|
|
80
|
+
},
|
|
81
|
+
});
|
|
82
|
+
let stdout = '';
|
|
83
|
+
let stderr = '';
|
|
84
|
+
let settled = false;
|
|
85
|
+
const timeout = setTimeout(() => {
|
|
86
|
+
if (!settled) {
|
|
87
|
+
settled = true;
|
|
88
|
+
proc.kill('SIGKILL');
|
|
89
|
+
reject(new Error(`MJPostgresTranspiler: dialect invocation timed out after ${this.timeoutMs}ms`));
|
|
90
|
+
}
|
|
91
|
+
}, this.timeoutMs);
|
|
92
|
+
proc.stdout.on('data', (chunk) => { stdout += chunk.toString(); });
|
|
93
|
+
proc.stderr.on('data', (chunk) => { stderr += chunk.toString(); });
|
|
94
|
+
proc.on('error', (err) => {
|
|
95
|
+
if (settled)
|
|
96
|
+
return;
|
|
97
|
+
settled = true;
|
|
98
|
+
clearTimeout(timeout);
|
|
99
|
+
reject(err.code === 'ENOENT'
|
|
100
|
+
? new Error(`MJPostgresTranspiler: Python interpreter '${this.pythonPath}' not found. ` +
|
|
101
|
+
'Install Python 3.10+ and set MJ_SQLGLOT_PYTHON to its path (or ensure python3 is on PATH).')
|
|
102
|
+
: new Error(`MJPostgresTranspiler: failed to spawn dialect: ${err.message}`));
|
|
103
|
+
});
|
|
104
|
+
proc.on('close', (code) => {
|
|
105
|
+
if (settled)
|
|
106
|
+
return;
|
|
107
|
+
settled = true;
|
|
108
|
+
clearTimeout(timeout);
|
|
109
|
+
if (code === 0) {
|
|
110
|
+
resolve(stdout);
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
if (/ModuleNotFoundError.*sqlglot/.test(stderr)) {
|
|
114
|
+
reject(new Error(`MJPostgresTranspiler: the interpreter '${this.pythonPath}' has no sqlglot module. ` +
|
|
115
|
+
`Install it with: ${this.pythonPath} -m pip install 'sqlglot>=27'`));
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
reject(new Error(`MJPostgresTranspiler: dialect exited with code ${code}.` +
|
|
119
|
+
(stderr ? `\nstderr: ${stderr.slice(0, 500)}` : '')));
|
|
120
|
+
});
|
|
121
|
+
proc.stdin.write(stdin);
|
|
122
|
+
proc.stdin.end();
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
//# sourceMappingURL=MJPostgresTranspiler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MJPostgresTranspiler.js","sourceRoot":"","sources":["../src/MJPostgresTranspiler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;AAmC3C;;;;GAIG;AACH,SAAS,kBAAkB;IACzB,MAAM,UAAU,GAAG;QACjB,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,gBAAgB,CAAC,EAAE,aAAa;QAC/E,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,QAAQ,EAAE,gBAAgB,CAAC,EAAe,qBAAqB;KACxF,CAAC;IACF,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACnC,IAAI,UAAU,CAAC,SAAS,CAAC;YAAE,OAAO,SAAS,CAAC;IAC9C,CAAC;IACD,OAAO,UAAU,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,CAAC,CAAC,EAAE,CAAC,CACtD,CACF,CAAC;YACJ,CAAC,CAAC,CAAC;YAEH,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YACxB,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;QACnB,CAAC,CAAC,CAAC;IACL,CAAC;CACF"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
export { SqlGlotClient } from './SqlGlotClient.js';
|
|
2
|
+
export { MJPostgresTranspiler } from './MJPostgresTranspiler.js';
|
|
3
|
+
export type { MJPostgresTranspilerOptions, MJPostgresTranspileResult, MJUnhandledStatement, } from './MJPostgresTranspiler.js';
|
|
2
4
|
export type { SQLDialect, ErrorLevel, TranspileOptions, TranspileResult, ParseOptions, ParseResult, SqlGlotClientOptions, HealthStatus, } from './types.js';
|
|
3
5
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,YAAY,EACV,UAAU,EACV,UAAU,EACV,gBAAgB,EAChB,eAAe,EACf,YAAY,EACZ,WAAW,EACX,oBAAoB,EACpB,YAAY,GACb,MAAM,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,YAAY,EACV,2BAA2B,EAC3B,yBAAyB,EACzB,oBAAoB,GACrB,MAAM,2BAA2B,CAAC;AACnC,YAAY,EACV,UAAU,EACV,UAAU,EACV,gBAAgB,EAChB,eAAe,EACf,YAAY,EACZ,WAAW,EACX,oBAAoB,EACpB,YAAY,GACb,MAAM,YAAY,CAAC"}
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memberjunction/sqlglot-ts",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.43.0",
|
|
4
4
|
"description": "TypeScript wrapper for Python's sqlglot SQL transpiler. Manages a local Python FastAPI microservice to provide deterministic SQL dialect conversion.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|