@rex0220/kintone-sql-tools 2.1.1 → 2.1.2
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-cli/ksql.js +16 -11
- package/dist-mcp/ksql-mcp.js +17 -12
- package/dist-mcpb/ksql-mcp.mcpb +0 -0
- package/package.json +1 -1
package/dist-cli/ksql.js
CHANGED
|
@@ -1033,14 +1033,20 @@ var Parser = class {
|
|
|
1033
1033
|
}
|
|
1034
1034
|
const aggFunc = this.tryAggregateFunc();
|
|
1035
1035
|
if (aggFunc !== null) {
|
|
1036
|
-
const
|
|
1036
|
+
const ref = this.parseAggregateRef(aggFunc);
|
|
1037
1037
|
if (this.isArithOp(this.peek().kind)) {
|
|
1038
|
-
const
|
|
1039
|
-
const
|
|
1040
|
-
|
|
1041
|
-
return { type: "ARITH_AGG_COL", expr, alias: alias2 };
|
|
1038
|
+
const expr = this.continueAggArith(ref);
|
|
1039
|
+
const alias3 = this.consume("AS" /* AS */) ? this.parseAliasName() : null;
|
|
1040
|
+
return { type: "ARITH_AGG_COL", expr, alias: alias3 };
|
|
1042
1041
|
}
|
|
1043
|
-
|
|
1042
|
+
const alias2 = this.consume("AS" /* AS */) ? this.parseAliasName() : null;
|
|
1043
|
+
return {
|
|
1044
|
+
type: "AGGREGATE",
|
|
1045
|
+
func: ref.func,
|
|
1046
|
+
distinct: ref.distinct,
|
|
1047
|
+
arg: ref.arg,
|
|
1048
|
+
alias: alias2
|
|
1049
|
+
};
|
|
1044
1050
|
}
|
|
1045
1051
|
if (this.peek().kind === "(" /* LPAREN */ && this.peekAt(1).kind === "SELECT" /* SELECT */) {
|
|
1046
1052
|
this.advance();
|
|
@@ -1124,8 +1130,7 @@ var Parser = class {
|
|
|
1124
1130
|
}
|
|
1125
1131
|
const aggFunc = this.tryAggregateFunc();
|
|
1126
1132
|
if (aggFunc !== null) {
|
|
1127
|
-
|
|
1128
|
-
return { type: "AGG_REF", func: aggCol.func, distinct: aggCol.distinct, arg: aggCol.arg };
|
|
1133
|
+
return this.parseAggregateRef(aggFunc);
|
|
1129
1134
|
}
|
|
1130
1135
|
throw new ParseError("\u96C6\u8A08\u7B97\u8853\u5F0F\u306B\u306F\u96C6\u8A08\u95A2\u6570\u307E\u305F\u306F\u6570\u5024\u304C\u5FC5\u8981\u3067\u3059", this.peek());
|
|
1131
1136
|
}
|
|
@@ -1416,7 +1421,8 @@ var Parser = class {
|
|
|
1416
1421
|
const kind = this.peek().kind;
|
|
1417
1422
|
return map[kind] ?? null;
|
|
1418
1423
|
}
|
|
1419
|
-
|
|
1424
|
+
/** 集計関数参照を読む。SELECT 列の alias は呼び出し側で式全体の後に処理する。 */
|
|
1425
|
+
parseAggregateRef(func) {
|
|
1420
1426
|
this.advance();
|
|
1421
1427
|
this.expect("(" /* LPAREN */);
|
|
1422
1428
|
const distinct = this.consume("DISTINCT" /* DISTINCT */);
|
|
@@ -1427,8 +1433,7 @@ var Parser = class {
|
|
|
1427
1433
|
arg = this.parseArithAddSub();
|
|
1428
1434
|
}
|
|
1429
1435
|
this.expect(")" /* RPAREN */);
|
|
1430
|
-
|
|
1431
|
-
return { type: "AGGREGATE", func, distinct, arg, alias };
|
|
1436
|
+
return { type: "AGG_REF", func, distinct, arg };
|
|
1432
1437
|
}
|
|
1433
1438
|
// ----------------------------------------------------------
|
|
1434
1439
|
// FROM / JOIN
|
package/dist-mcp/ksql-mcp.js
CHANGED
|
@@ -31946,14 +31946,20 @@ var Parser = class {
|
|
|
31946
31946
|
}
|
|
31947
31947
|
const aggFunc = this.tryAggregateFunc();
|
|
31948
31948
|
if (aggFunc !== null) {
|
|
31949
|
-
const
|
|
31949
|
+
const ref = this.parseAggregateRef(aggFunc);
|
|
31950
31950
|
if (this.isArithOp(this.peek().kind)) {
|
|
31951
|
-
const
|
|
31952
|
-
const
|
|
31953
|
-
|
|
31954
|
-
return { type: "ARITH_AGG_COL", expr, alias: alias2 };
|
|
31951
|
+
const expr = this.continueAggArith(ref);
|
|
31952
|
+
const alias3 = this.consume("AS" /* AS */) ? this.parseAliasName() : null;
|
|
31953
|
+
return { type: "ARITH_AGG_COL", expr, alias: alias3 };
|
|
31955
31954
|
}
|
|
31956
|
-
|
|
31955
|
+
const alias2 = this.consume("AS" /* AS */) ? this.parseAliasName() : null;
|
|
31956
|
+
return {
|
|
31957
|
+
type: "AGGREGATE",
|
|
31958
|
+
func: ref.func,
|
|
31959
|
+
distinct: ref.distinct,
|
|
31960
|
+
arg: ref.arg,
|
|
31961
|
+
alias: alias2
|
|
31962
|
+
};
|
|
31957
31963
|
}
|
|
31958
31964
|
if (this.peek().kind === "(" /* LPAREN */ && this.peekAt(1).kind === "SELECT" /* SELECT */) {
|
|
31959
31965
|
this.advance();
|
|
@@ -32037,8 +32043,7 @@ var Parser = class {
|
|
|
32037
32043
|
}
|
|
32038
32044
|
const aggFunc = this.tryAggregateFunc();
|
|
32039
32045
|
if (aggFunc !== null) {
|
|
32040
|
-
|
|
32041
|
-
return { type: "AGG_REF", func: aggCol.func, distinct: aggCol.distinct, arg: aggCol.arg };
|
|
32046
|
+
return this.parseAggregateRef(aggFunc);
|
|
32042
32047
|
}
|
|
32043
32048
|
throw new ParseError("\u96C6\u8A08\u7B97\u8853\u5F0F\u306B\u306F\u96C6\u8A08\u95A2\u6570\u307E\u305F\u306F\u6570\u5024\u304C\u5FC5\u8981\u3067\u3059", this.peek());
|
|
32044
32049
|
}
|
|
@@ -32329,7 +32334,8 @@ var Parser = class {
|
|
|
32329
32334
|
const kind = this.peek().kind;
|
|
32330
32335
|
return map2[kind] ?? null;
|
|
32331
32336
|
}
|
|
32332
|
-
|
|
32337
|
+
/** 集計関数参照を読む。SELECT 列の alias は呼び出し側で式全体の後に処理する。 */
|
|
32338
|
+
parseAggregateRef(func) {
|
|
32333
32339
|
this.advance();
|
|
32334
32340
|
this.expect("(" /* LPAREN */);
|
|
32335
32341
|
const distinct = this.consume("DISTINCT" /* DISTINCT */);
|
|
@@ -32340,8 +32346,7 @@ var Parser = class {
|
|
|
32340
32346
|
arg = this.parseArithAddSub();
|
|
32341
32347
|
}
|
|
32342
32348
|
this.expect(")" /* RPAREN */);
|
|
32343
|
-
|
|
32344
|
-
return { type: "AGGREGATE", func, distinct, arg, alias };
|
|
32349
|
+
return { type: "AGG_REF", func, distinct, arg };
|
|
32345
32350
|
}
|
|
32346
32351
|
// ----------------------------------------------------------
|
|
32347
32352
|
// FROM / JOIN
|
|
@@ -39977,7 +39982,7 @@ Options:
|
|
|
39977
39982
|
-h, --help Show help
|
|
39978
39983
|
`);
|
|
39979
39984
|
}
|
|
39980
|
-
var SERVER_VERSION = true ? "2.1.
|
|
39985
|
+
var SERVER_VERSION = true ? "2.1.2" : "0.0.0-dev";
|
|
39981
39986
|
function createServer(args) {
|
|
39982
39987
|
const server = new McpServer({
|
|
39983
39988
|
name: "ksql-mcp",
|
package/dist-mcpb/ksql-mcp.mcpb
CHANGED
|
Binary file
|