@sqg/sqg 0.16.2 → 0.17.3
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/index.mjs +62 -5
- package/dist/sqg.mjs +67 -10
- package/dist/{ide-BieFvmwk.mjs → start-ui-DuHxwbjr.mjs} +8 -8
- package/dist/templates/java-jdbc.hbs +55 -3
- package/dist/ui-public/assets/index-Bt3dXI_J.js +45 -0
- package/dist/{ide-public → ui-public}/index.html +1 -1
- package/dist/{ide-server.mjs → ui-server.mjs} +71 -72
- package/package.json +11 -11
- package/dist/ide-public/assets/index-DPVATxCE.js +0 -45
- /package/dist/{ide-public → ui-public}/assets/index-DHD4h34g.css +0 -0
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
8
8
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
9
9
|
<link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&display=swap" rel="stylesheet" />
|
|
10
|
-
<script type="module" crossorigin src="/assets/index-
|
|
10
|
+
<script type="module" crossorigin src="/assets/index-Bt3dXI_J.js"></script>
|
|
11
11
|
<link rel="stylesheet" crossorigin href="/assets/index-DHD4h34g.css">
|
|
12
12
|
</head>
|
|
13
13
|
<body class="bg-gray-900 text-gray-100">
|
|
@@ -13228,31 +13228,28 @@ var require_schemes = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
13228
13228
|
parse: wsParse,
|
|
13229
13229
|
serialize: wsSerialize
|
|
13230
13230
|
};
|
|
13231
|
-
const wss = {
|
|
13232
|
-
scheme: "wss",
|
|
13233
|
-
domainHost: ws.domainHost,
|
|
13234
|
-
parse: ws.parse,
|
|
13235
|
-
serialize: ws.serialize
|
|
13236
|
-
};
|
|
13237
|
-
const urn = {
|
|
13238
|
-
scheme: "urn",
|
|
13239
|
-
parse: urnParse,
|
|
13240
|
-
serialize: urnSerialize,
|
|
13241
|
-
skipNormalize: true
|
|
13242
|
-
};
|
|
13243
|
-
const urnuuid = {
|
|
13244
|
-
scheme: "urn:uuid",
|
|
13245
|
-
parse: urnuuidParse,
|
|
13246
|
-
serialize: urnuuidSerialize,
|
|
13247
|
-
skipNormalize: true
|
|
13248
|
-
};
|
|
13249
13231
|
const SCHEMES = {
|
|
13250
13232
|
http,
|
|
13251
13233
|
https,
|
|
13252
13234
|
ws,
|
|
13253
|
-
wss
|
|
13254
|
-
|
|
13255
|
-
|
|
13235
|
+
wss: {
|
|
13236
|
+
scheme: "wss",
|
|
13237
|
+
domainHost: ws.domainHost,
|
|
13238
|
+
parse: ws.parse,
|
|
13239
|
+
serialize: ws.serialize
|
|
13240
|
+
},
|
|
13241
|
+
urn: {
|
|
13242
|
+
scheme: "urn",
|
|
13243
|
+
parse: urnParse,
|
|
13244
|
+
serialize: urnSerialize,
|
|
13245
|
+
skipNormalize: true
|
|
13246
|
+
},
|
|
13247
|
+
"urn:uuid": {
|
|
13248
|
+
scheme: "urn:uuid",
|
|
13249
|
+
parse: urnuuidParse,
|
|
13250
|
+
serialize: urnuuidSerialize,
|
|
13251
|
+
skipNormalize: true
|
|
13252
|
+
}
|
|
13256
13253
|
};
|
|
13257
13254
|
Object.setPrototypeOf(SCHEMES, null);
|
|
13258
13255
|
/**
|
|
@@ -22274,6 +22271,7 @@ var require_min_version = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
22274
22271
|
break;
|
|
22275
22272
|
case "<":
|
|
22276
22273
|
case "<=": break;
|
|
22274
|
+
/* istanbul ignore next */
|
|
22277
22275
|
default: throw new Error(`Unexpected operation: ${comparator.operator}`);
|
|
22278
22276
|
}
|
|
22279
22277
|
});
|
|
@@ -30270,8 +30268,8 @@ var require_vary = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
30270
30268
|
module.exports.parse = parse;
|
|
30271
30269
|
}));
|
|
30272
30270
|
//#endregion
|
|
30273
|
-
//#region ../../node_modules/.pnpm/@
|
|
30274
|
-
var
|
|
30271
|
+
//#region ../../node_modules/.pnpm/@fastify+cors@11.2.0/node_modules/@fastify/cors/index.js
|
|
30272
|
+
var require_cors = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
30275
30273
|
const fp = require_plugin();
|
|
30276
30274
|
const { addAccessControlRequestHeadersToVaryHeader, addOriginToVaryHeader } = require_vary();
|
|
30277
30275
|
const defaultOptions = {
|
|
@@ -30456,8 +30454,11 @@ var import_cors = /* @__PURE__ */ __toESM$1((/* @__PURE__ */ __commonJSMin(((exp
|
|
|
30456
30454
|
module.exports = _fastifyCors;
|
|
30457
30455
|
module.exports.fastifyCors = _fastifyCors;
|
|
30458
30456
|
module.exports.default = _fastifyCors;
|
|
30459
|
-
}))
|
|
30457
|
+
}));
|
|
30458
|
+
//#endregion
|
|
30459
|
+
//#region ../../node_modules/.pnpm/@trpc+server@11.14.1_typescript@6.0.2/node_modules/@trpc/server/dist/codes-DagpWZLc.mjs
|
|
30460
30460
|
var import_fastify = /* @__PURE__ */ __toESM$1(require_fastify(), 1);
|
|
30461
|
+
var import_cors = /* @__PURE__ */ __toESM$1(require_cors(), 1);
|
|
30461
30462
|
/**
|
|
30462
30463
|
* Ensures there are no duplicate keys when building a procedure.
|
|
30463
30464
|
* @internal
|
|
@@ -30568,7 +30569,7 @@ const TRPC_ERROR_CODES_BY_NUMBER = {
|
|
|
30568
30569
|
};
|
|
30569
30570
|
TRPC_ERROR_CODES_BY_KEY.BAD_GATEWAY, TRPC_ERROR_CODES_BY_KEY.SERVICE_UNAVAILABLE, TRPC_ERROR_CODES_BY_KEY.GATEWAY_TIMEOUT, TRPC_ERROR_CODES_BY_KEY.INTERNAL_SERVER_ERROR;
|
|
30570
30571
|
//#endregion
|
|
30571
|
-
//#region ../../node_modules/.pnpm/@trpc+server@11.14.1_typescript@
|
|
30572
|
+
//#region ../../node_modules/.pnpm/@trpc+server@11.14.1_typescript@6.0.2/node_modules/@trpc/server/dist/getErrorShape-vC8mUXJD.mjs
|
|
30572
30573
|
var __create = Object.create;
|
|
30573
30574
|
var __defProp = Object.defineProperty;
|
|
30574
30575
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -30765,7 +30766,7 @@ function getErrorShape(opts) {
|
|
|
30765
30766
|
return config.errorFormatter((0, import_objectSpread2$6.default)((0, import_objectSpread2$6.default)({}, opts), {}, { shape }));
|
|
30766
30767
|
}
|
|
30767
30768
|
//#endregion
|
|
30768
|
-
//#region ../../node_modules/.pnpm/@trpc+server@11.14.1_typescript@
|
|
30769
|
+
//#region ../../node_modules/.pnpm/@trpc+server@11.14.1_typescript@6.0.2/node_modules/@trpc/server/dist/tracked-Bjtgv3wJ.mjs
|
|
30769
30770
|
const defaultFormatter = ({ shape }) => {
|
|
30770
30771
|
return shape;
|
|
30771
30772
|
};
|
|
@@ -31047,7 +31048,7 @@ function isTrackedEnvelope(value) {
|
|
|
31047
31048
|
return Array.isArray(value) && value[2] === trackedSymbol;
|
|
31048
31049
|
}
|
|
31049
31050
|
//#endregion
|
|
31050
|
-
//#region ../../node_modules/.pnpm/@trpc+server@11.14.1_typescript@
|
|
31051
|
+
//#region ../../node_modules/.pnpm/@trpc+server@11.14.1_typescript@6.0.2/node_modules/@trpc/server/dist/parseTRPCMessage-CTow-umk.mjs
|
|
31051
31052
|
const procedureTypes = [
|
|
31052
31053
|
"query",
|
|
31053
31054
|
"mutation",
|
|
@@ -31101,7 +31102,7 @@ function parseTRPCMessage(obj, transformer) {
|
|
|
31101
31102
|
};
|
|
31102
31103
|
}
|
|
31103
31104
|
//#endregion
|
|
31104
|
-
//#region ../../node_modules/.pnpm/@trpc+server@11.14.1_typescript@
|
|
31105
|
+
//#region ../../node_modules/.pnpm/@trpc+server@11.14.1_typescript@6.0.2/node_modules/@trpc/server/dist/observable-UMO3vUa_.mjs
|
|
31105
31106
|
/** @public */
|
|
31106
31107
|
function isObservable(x) {
|
|
31107
31108
|
return typeof x === "object" && x !== null && "subscribe" in x;
|
|
@@ -31174,7 +31175,7 @@ function observableToAsyncIterable(observable$1, signal) {
|
|
|
31174
31175
|
} };
|
|
31175
31176
|
}
|
|
31176
31177
|
//#endregion
|
|
31177
|
-
//#region ../../node_modules/.pnpm/@trpc+server@11.14.1_typescript@
|
|
31178
|
+
//#region ../../node_modules/.pnpm/@trpc+server@11.14.1_typescript@6.0.2/node_modules/@trpc/server/dist/resolveResponse-DbcCY-yX.mjs
|
|
31178
31179
|
function parseConnectionParamsFromUnknown(parsed) {
|
|
31179
31180
|
try {
|
|
31180
31181
|
if (parsed === null) return null;
|
|
@@ -32936,7 +32937,7 @@ async function resolveResponse(opts) {
|
|
|
32936
32937
|
}
|
|
32937
32938
|
}
|
|
32938
32939
|
//#endregion
|
|
32939
|
-
//#region ../../node_modules/.pnpm/@trpc+server@11.14.1_typescript@
|
|
32940
|
+
//#region ../../node_modules/.pnpm/@trpc+server@11.14.1_typescript@6.0.2/node_modules/@trpc/server/dist/initTRPC-RoZMIBeA.mjs
|
|
32940
32941
|
var import_objectSpread2$2$2 = __toESM(require_objectSpread2(), 1);
|
|
32941
32942
|
/** @internal */
|
|
32942
32943
|
const middlewareMarker = "middlewareMarker";
|
|
@@ -33250,7 +33251,7 @@ const initTRPC = new class TRPCBuilder {
|
|
|
33250
33251
|
}
|
|
33251
33252
|
}();
|
|
33252
33253
|
//#endregion
|
|
33253
|
-
//#region ../../node_modules/.pnpm/@trpc+server@11.14.1_typescript@
|
|
33254
|
+
//#region ../../node_modules/.pnpm/@trpc+server@11.14.1_typescript@6.0.2/node_modules/@trpc/server/dist/node-http-DZiUEwuh.mjs
|
|
33254
33255
|
function createBody(req, opts) {
|
|
33255
33256
|
if ("body" in req) {
|
|
33256
33257
|
if (req.body === void 0) return void 0;
|
|
@@ -33338,7 +33339,7 @@ function incomingMessageToRequest(req, res, opts) {
|
|
|
33338
33339
|
}
|
|
33339
33340
|
__toESM(require_objectSpread2(), 1);
|
|
33340
33341
|
//#endregion
|
|
33341
|
-
//#region ../../node_modules/.pnpm/@trpc+server@11.14.1_typescript@
|
|
33342
|
+
//#region ../../node_modules/.pnpm/@trpc+server@11.14.1_typescript@6.0.2/node_modules/@trpc/server/dist/ws-Dmi9HHSk.mjs
|
|
33342
33343
|
/**
|
|
33343
33344
|
* Default JSON encoder - used when no encoder is specified.
|
|
33344
33345
|
* This maintains backwards compatibility with existing behavior.
|
|
@@ -33763,7 +33764,7 @@ function handleKeepAlive(client, pingMs = 3e4, pongWaitMs = 5e3) {
|
|
|
33763
33764
|
schedulePing();
|
|
33764
33765
|
}
|
|
33765
33766
|
//#endregion
|
|
33766
|
-
//#region ../../node_modules/.pnpm/@trpc+server@11.14.1_typescript@
|
|
33767
|
+
//#region ../../node_modules/.pnpm/@trpc+server@11.14.1_typescript@6.0.2/node_modules/@trpc/server/dist/adapters/fastify/index.mjs
|
|
33767
33768
|
var import_objectSpread2$1 = __toESM(require_objectSpread2(), 1);
|
|
33768
33769
|
async function fastifyRequestHandler(opts) {
|
|
33769
33770
|
const createContext = async (innerOpts) => {
|
|
@@ -40047,7 +40048,7 @@ function getSpecializer(spec) {
|
|
|
40047
40048
|
return spec.get;
|
|
40048
40049
|
}
|
|
40049
40050
|
//#endregion
|
|
40050
|
-
//#region
|
|
40051
|
+
//#region ../shared/src/parser/cte-parser.ts
|
|
40051
40052
|
const parser = LRParser.deserialize({
|
|
40052
40053
|
version: 14,
|
|
40053
40054
|
states: "&fQVQPOOOkQPO'#ClO!SQPO'#C^OOQO'#Co'#CoOOQO'#Cw'#CwOOQO'#Cp'#CpQVQPOOO!_QPO,59WOOQO'#Cy'#CyOOQO'#Cr'#CrO!xQPO'#CjOOQO'#Cq'#CqO!VQPO,58xOOQO'#Cc'#CcO#PQPO'#CbO#UQPO,58xO!VQPO,58xOOQO-E6n-E6nOOQO1G.r1G.rOOQO-E6p-E6pOOQO-E6o-E6oO#pQPO1G.dO$[QPO,58|O!VQPO'#CsO#pQPO1G.dO!VQPO1G.dO$gQPO7+$OO%RQPO'#CfOOQO'#Cf'#CfOkQPO'#CiOOQO1G.h1G.hO$bQPO1G.hO!VQPO,59_OOQO,59_,59_OOQO-E6q-E6qO$gQPO7+$OOOQO,59Q,59QO%WQPO,59TOOQO7+$S7+$SOOQO1G.y1G.yO%]QPO<<GjOOQO1G.o1G.o",
|
|
@@ -40063,7 +40064,7 @@ const parser = LRParser.deserialize({
|
|
|
40063
40064
|
tokenPrec: 223
|
|
40064
40065
|
});
|
|
40065
40066
|
//#endregion
|
|
40066
|
-
//#region
|
|
40067
|
+
//#region ../shared/src/parser/cte-extractor.ts
|
|
40067
40068
|
/**
|
|
40068
40069
|
* CTE Extractor using Lezer parser
|
|
40069
40070
|
* Extracts Common Table Expression definitions from SQL queries
|
|
@@ -40152,6 +40153,13 @@ function extractCTEs(sql) {
|
|
|
40152
40153
|
//#endregion
|
|
40153
40154
|
//#region src/db/cte-helpers.ts
|
|
40154
40155
|
/**
|
|
40156
|
+
* Strip SQG annotations from SQL before execution.
|
|
40157
|
+
* Removes comment headers (-- QUERY, -- EXEC, etc.) and @set variable lines.
|
|
40158
|
+
*/
|
|
40159
|
+
function stripAnnotations(sql) {
|
|
40160
|
+
return sql.replace(/^\s*--\s*(QUERY|EXEC|MIGRATE|TESTDATA|TABLE)\s+.*/gm, "").replace(/@set\s+\w+\s*=\s*.+/g, "").trim();
|
|
40161
|
+
}
|
|
40162
|
+
/**
|
|
40155
40163
|
* Execute a specific CTE by reconstructing the query up to that CTE.
|
|
40156
40164
|
* Shared across all database adapters.
|
|
40157
40165
|
*/
|
|
@@ -40273,7 +40281,7 @@ function createDuckDBAdapter() {
|
|
|
40273
40281
|
return previewAllCTEsHelper(adapter, fullSql);
|
|
40274
40282
|
},
|
|
40275
40283
|
async executeSQLReadOnly(sql, applyLimit = true) {
|
|
40276
|
-
const cleanSql = sql
|
|
40284
|
+
const cleanSql = stripAnnotations(sql);
|
|
40277
40285
|
const conn = await getConnection();
|
|
40278
40286
|
await conn.run("BEGIN TRANSACTION");
|
|
40279
40287
|
try {
|
|
@@ -40286,12 +40294,12 @@ function createDuckDBAdapter() {
|
|
|
40286
40294
|
let migrationsRun = 0;
|
|
40287
40295
|
let testdataRun = 0;
|
|
40288
40296
|
for (const sql of migrations) {
|
|
40289
|
-
const cleanSql = sql
|
|
40297
|
+
const cleanSql = stripAnnotations(sql);
|
|
40290
40298
|
if (cleanSql) await adapter.executeSQL(cleanSql, false);
|
|
40291
40299
|
migrationsRun++;
|
|
40292
40300
|
}
|
|
40293
40301
|
for (const sql of testdata) {
|
|
40294
|
-
const cleanSql = sql
|
|
40302
|
+
const cleanSql = stripAnnotations(sql);
|
|
40295
40303
|
if (cleanSql) await adapter.executeSQL(cleanSql, false);
|
|
40296
40304
|
testdataRun++;
|
|
40297
40305
|
}
|
|
@@ -40378,10 +40386,11 @@ function createSQLiteAdapter() {
|
|
|
40378
40386
|
return previewAllCTEsHelper(adapter, fullSql);
|
|
40379
40387
|
},
|
|
40380
40388
|
async executeSQLReadOnly(sql, applyLimit = true) {
|
|
40389
|
+
const cleanSql = stripAnnotations(sql);
|
|
40381
40390
|
const database = getDb();
|
|
40382
40391
|
database.exec("SAVEPOINT sqg_readonly");
|
|
40383
40392
|
try {
|
|
40384
|
-
return await adapter.executeSQL(
|
|
40393
|
+
return await adapter.executeSQL(cleanSql, applyLimit);
|
|
40385
40394
|
} finally {
|
|
40386
40395
|
database.exec("ROLLBACK TO SAVEPOINT sqg_readonly");
|
|
40387
40396
|
database.exec("RELEASE SAVEPOINT sqg_readonly");
|
|
@@ -40392,12 +40401,12 @@ function createSQLiteAdapter() {
|
|
|
40392
40401
|
let testdataRun = 0;
|
|
40393
40402
|
const database = getDb();
|
|
40394
40403
|
for (const sql of migrations) {
|
|
40395
|
-
const cleanSql = sql
|
|
40404
|
+
const cleanSql = stripAnnotations(sql);
|
|
40396
40405
|
if (cleanSql) database.exec(cleanSql);
|
|
40397
40406
|
migrationsRun++;
|
|
40398
40407
|
}
|
|
40399
40408
|
for (const sql of testdata) {
|
|
40400
|
-
const cleanSql = sql
|
|
40409
|
+
const cleanSql = stripAnnotations(sql);
|
|
40401
40410
|
if (cleanSql) database.exec(cleanSql);
|
|
40402
40411
|
testdataRun++;
|
|
40403
40412
|
}
|
|
@@ -40478,10 +40487,11 @@ function createPostgresAdapter(connectionString) {
|
|
|
40478
40487
|
return previewAllCTEsHelper(adapter, fullSql);
|
|
40479
40488
|
},
|
|
40480
40489
|
async executeSQLReadOnly(sql, applyLimit = true) {
|
|
40490
|
+
const cleanSql = stripAnnotations(sql);
|
|
40481
40491
|
const p = getPool();
|
|
40482
40492
|
await p.query("SAVEPOINT sqg_readonly");
|
|
40483
40493
|
try {
|
|
40484
|
-
return await adapter.executeSQL(
|
|
40494
|
+
return await adapter.executeSQL(cleanSql, applyLimit);
|
|
40485
40495
|
} finally {
|
|
40486
40496
|
await p.query("ROLLBACK TO SAVEPOINT sqg_readonly");
|
|
40487
40497
|
await p.query("RELEASE SAVEPOINT sqg_readonly");
|
|
@@ -40492,12 +40502,12 @@ function createPostgresAdapter(connectionString) {
|
|
|
40492
40502
|
let testdataRun = 0;
|
|
40493
40503
|
const p = getPool();
|
|
40494
40504
|
for (const sql of migrations) {
|
|
40495
|
-
const cleanSql = sql
|
|
40505
|
+
const cleanSql = stripAnnotations(sql);
|
|
40496
40506
|
if (cleanSql) await p.query(cleanSql);
|
|
40497
40507
|
migrationsRun++;
|
|
40498
40508
|
}
|
|
40499
40509
|
for (const sql of testdata) {
|
|
40500
|
-
const cleanSql = sql
|
|
40510
|
+
const cleanSql = stripAnnotations(sql);
|
|
40501
40511
|
if (cleanSql) await p.query(cleanSql);
|
|
40502
40512
|
testdataRun++;
|
|
40503
40513
|
}
|
|
@@ -40635,7 +40645,8 @@ function parseProject(configPath) {
|
|
|
40635
40645
|
id: q.id,
|
|
40636
40646
|
order: parseInt(q.id.split("_")[1] || "0", 10) || 0,
|
|
40637
40647
|
sql: q.rawQuery,
|
|
40638
|
-
file
|
|
40648
|
+
file,
|
|
40649
|
+
line: q.line
|
|
40639
40650
|
});
|
|
40640
40651
|
else if (q.isTestdata) testdata.push(q.rawQuery);
|
|
40641
40652
|
else {
|
|
@@ -40653,14 +40664,16 @@ function parseProject(configPath) {
|
|
|
40653
40664
|
pluck: q.isPluck
|
|
40654
40665
|
},
|
|
40655
40666
|
variables: vars,
|
|
40656
|
-
file
|
|
40667
|
+
file,
|
|
40668
|
+
line: q.line
|
|
40657
40669
|
});
|
|
40658
40670
|
}
|
|
40659
40671
|
for (const t of parsed.tables) tables.push({
|
|
40660
40672
|
id: t.id,
|
|
40661
40673
|
tableName: t.tableName,
|
|
40662
40674
|
hasAppender: t.hasAppender,
|
|
40663
|
-
file
|
|
40675
|
+
file,
|
|
40676
|
+
line: t.line
|
|
40664
40677
|
});
|
|
40665
40678
|
}
|
|
40666
40679
|
migrations.sort((a, b) => a.order - b.order);
|
|
@@ -40796,39 +40809,25 @@ const appRouter = t.router({
|
|
|
40796
40809
|
const result = parseSQLQueries(tmpPath, []);
|
|
40797
40810
|
const lines = input.content.split("\n");
|
|
40798
40811
|
for (const q of result.queries) {
|
|
40799
|
-
const pattern = new RegExp(`^--\\s+${q.type}\\s+${q.id.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}\\b`);
|
|
40800
|
-
let line = 1;
|
|
40801
|
-
for (let i = 0; i < lines.length; i++) if (pattern.test(lines[i])) {
|
|
40802
|
-
line = i + 1;
|
|
40803
|
-
break;
|
|
40804
|
-
}
|
|
40805
40812
|
const vars = Object.fromEntries(q.variables);
|
|
40806
40813
|
const resolvedSql = q.rawQuery.replace(/\$\{(\w+)\}/g, (_, v) => vars[v] ?? `\${${v}}`);
|
|
40807
40814
|
annotations.push({
|
|
40808
40815
|
id: q.id,
|
|
40809
40816
|
type: q.type,
|
|
40810
|
-
line,
|
|
40817
|
+
line: q.line,
|
|
40811
40818
|
one: q.isOne,
|
|
40812
40819
|
pluck: q.isPluck,
|
|
40813
40820
|
sql: resolvedSql
|
|
40814
40821
|
});
|
|
40815
40822
|
}
|
|
40816
|
-
for (const t of result.tables) {
|
|
40817
|
-
|
|
40818
|
-
|
|
40819
|
-
|
|
40820
|
-
|
|
40821
|
-
|
|
40822
|
-
|
|
40823
|
-
|
|
40824
|
-
id: t.id,
|
|
40825
|
-
type: "TABLE",
|
|
40826
|
-
line,
|
|
40827
|
-
one: false,
|
|
40828
|
-
pluck: false,
|
|
40829
|
-
sql: ""
|
|
40830
|
-
});
|
|
40831
|
-
}
|
|
40823
|
+
for (const t of result.tables) annotations.push({
|
|
40824
|
+
id: t.id,
|
|
40825
|
+
type: "TABLE",
|
|
40826
|
+
line: t.line,
|
|
40827
|
+
one: false,
|
|
40828
|
+
pluck: false,
|
|
40829
|
+
sql: ""
|
|
40830
|
+
});
|
|
40832
40831
|
const validModifiers = [
|
|
40833
40832
|
":one",
|
|
40834
40833
|
":pluck",
|
|
@@ -41069,8 +41068,8 @@ if (projectPathRaw) {
|
|
|
41069
41068
|
const server = (0, import_fastify.default)({ logger: false });
|
|
41070
41069
|
const __dirname$1 = dirname(fileURLToPath(import.meta.url));
|
|
41071
41070
|
const staticDir = [
|
|
41072
|
-
join(__dirname$1, "
|
|
41073
|
-
join(__dirname$1, "../
|
|
41071
|
+
join(__dirname$1, "ui-public"),
|
|
41072
|
+
join(__dirname$1, "../ui-public"),
|
|
41074
41073
|
join(__dirname$1, "../../frontend/dist")
|
|
41075
41074
|
].find((d) => existsSync(join(d, "index.html")));
|
|
41076
41075
|
const MIME_TYPES = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sqg/sqg",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.3",
|
|
4
4
|
"description": "SQG - SQL Query Generator - Type-safe code generation from SQL (https://sqg.dev)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.mjs",
|
|
@@ -43,10 +43,10 @@
|
|
|
43
43
|
"license": "Apache-2.0",
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@clack/prompts": "^1.1.0",
|
|
46
|
-
"@duckdb/node-api": "1.5.
|
|
46
|
+
"@duckdb/node-api": "1.5.1-r.1",
|
|
47
47
|
"@lezer/common": "^1.5.1",
|
|
48
48
|
"@lezer/lr": "^1.4.8",
|
|
49
|
-
"@modelcontextprotocol/sdk": "^1.
|
|
49
|
+
"@modelcontextprotocol/sdk": "^1.28.0",
|
|
50
50
|
"@testcontainers/postgresql": "^11.13.0",
|
|
51
51
|
"better-sqlite3": "^12.8.0",
|
|
52
52
|
"commander": "^14.0.3",
|
|
@@ -65,8 +65,8 @@
|
|
|
65
65
|
"zod": "^4.3.6"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
|
-
"@biomejs/biome": "2.4.
|
|
69
|
-
"@duckdb/node-bindings-linux-x64": "1.5.
|
|
68
|
+
"@biomejs/biome": "2.4.9",
|
|
69
|
+
"@duckdb/node-bindings-linux-x64": "1.5.1-r.1",
|
|
70
70
|
"@lezer-unofficial/printer": "^1.0.1",
|
|
71
71
|
"@lezer/generator": "^1.8.0",
|
|
72
72
|
"@libsql/client": "^0.17.2",
|
|
@@ -75,15 +75,15 @@
|
|
|
75
75
|
"@types/node": "^25.5.0",
|
|
76
76
|
"@types/pg": "^8.20.0",
|
|
77
77
|
"@types/update-notifier": "^6.0.8",
|
|
78
|
-
"@vitest/ui": "^4.1.
|
|
79
|
-
"tsdown": "0.21.
|
|
78
|
+
"@vitest/ui": "^4.1.1",
|
|
79
|
+
"tsdown": "0.21.5",
|
|
80
80
|
"tsx": "^4.21.0",
|
|
81
|
-
"typescript": "^
|
|
82
|
-
"vitest": "^4.1.
|
|
81
|
+
"typescript": "^6.0.2",
|
|
82
|
+
"vitest": "^4.1.2"
|
|
83
83
|
},
|
|
84
84
|
"scripts": {
|
|
85
|
-
"build": "tsc --noEmit && tsdown && cp -r src/templates dist && pnpm run build:
|
|
86
|
-
"build:
|
|
85
|
+
"build": "tsc --noEmit && tsdown && cp -r src/templates dist && pnpm run build:ui",
|
|
86
|
+
"build:ui": "cd ../sqg-ui/frontend && pnpx vite build && cd ../server && pnpx tsdown && cd ../../sqg && cp ../sqg-ui/server/dist/index.mjs dist/ui-server.mjs && cp -r ../sqg-ui/frontend/dist dist/ui-public",
|
|
87
87
|
"lezer-gen": "lezer-generator src/parser/sql.grammar -o src/parser/sql-parser.ts",
|
|
88
88
|
"test-grammar": "tsx src/test-grammar.ts",
|
|
89
89
|
"check": "biome check --write src/",
|