@squadbase/vite-server 0.1.9-dev.08f5c5f → 0.1.9-dev.3841401
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/index.js +586 -343
- package/dist/connectors/azure-sql.js +13 -2
- package/dist/connectors/clickup.js +1 -1
- package/dist/connectors/freshdesk.js +2 -2
- package/dist/connectors/freshsales.js +28 -28
- package/dist/connectors/freshservice.js +1 -1
- package/dist/connectors/github.js +1 -1
- package/dist/connectors/google-search-console-oauth.js +39 -8
- package/dist/connectors/jdbc.js +510 -98
- package/dist/connectors/monday.js +44 -4
- package/dist/connectors/oracle.js +13 -2
- package/dist/connectors/sqlserver.js +13 -2
- package/dist/connectors/supabase.js +1 -1
- package/dist/index.js +586 -343
- package/dist/main.js +586 -343
- package/dist/vite-plugin.js +586 -343
- package/package.json +1 -1
|
@@ -529,8 +529,8 @@ var mondayConnector = new ConnectorPlugin({
|
|
|
529
529
|
The business logic type for this connector is "typescript". Use the connector SDK in your handler. Do NOT read credentials from environment variables.
|
|
530
530
|
|
|
531
531
|
SDK methods (client created via \`connection(connectionId)\`):
|
|
532
|
-
- \`client.graphql(query, variables?)\` \u2014 send any GraphQL query/mutation
|
|
533
|
-
- \`client.request(init?)\` \u2014 low-level authenticated fetch to the GraphQL endpoint
|
|
532
|
+
- \`client.graphql(query, variables?)\` \u2014 send any GraphQL query/mutation. **Returns the GraphQL \`data\` payload directly with the outer \`{ data, errors }\` envelope already stripped.** For \`{ boards { ... } }\` you get \`{ boards: [...] }\`, NOT \`{ data: { boards: [...] } }\`. Access fields as \`result.boards\`, never \`result.data.boards\`. Errors are thrown automatically.
|
|
533
|
+
- \`client.request(init?)\` \u2014 low-level authenticated fetch to the GraphQL endpoint (returns the raw \`Response\`; you parse the full \`{ data, errors }\` envelope yourself)
|
|
534
534
|
- \`client.me()\` \u2014 get the authenticated user and account
|
|
535
535
|
- \`client.listBoards(options?)\` \u2014 list boards with optional ids, workspaceIds, state, page, limit
|
|
536
536
|
- \`client.getBoard(boardId)\` \u2014 fetch a single board with columns, groups, owners, tags
|
|
@@ -559,6 +559,26 @@ export default async function handler(c: Context) {
|
|
|
559
559
|
}
|
|
560
560
|
\`\`\`
|
|
561
561
|
|
|
562
|
+
#### \`client.graphql()\` return shape (common pitfall)
|
|
563
|
+
|
|
564
|
+
\`client.graphql()\` already unwraps the GraphQL response envelope. **Do not access \`.data\` on the return value** \u2014 it is always \`undefined\` and will silently produce empty results.
|
|
565
|
+
|
|
566
|
+
\`\`\`ts
|
|
567
|
+
// \u2705 Correct \u2014 fields are at the top level
|
|
568
|
+
const res = await monday.graphql<{ boards: { items_page: { items: unknown[] } }[] }>(
|
|
569
|
+
\`query($ids: [ID!], $limit: Int) {
|
|
570
|
+
boards(ids: $ids) {
|
|
571
|
+
items_page(limit: $limit) { cursor items { id name } }
|
|
572
|
+
}
|
|
573
|
+
}\`,
|
|
574
|
+
{ ids: [boardId], limit: 100 },
|
|
575
|
+
);
|
|
576
|
+
const items = res.boards?.[0]?.items_page?.items ?? [];
|
|
577
|
+
|
|
578
|
+
// \u274C Wrong \u2014 \`res.data\` is undefined; \`.data\` was already stripped by the SDK
|
|
579
|
+
const items = res.data?.boards?.[0]?.items_page?.items; // always undefined!
|
|
580
|
+
\`\`\`
|
|
581
|
+
|
|
562
582
|
### monday.com GraphQL API Reference
|
|
563
583
|
|
|
564
584
|
- Endpoint: \`https://api.monday.com/v2\`
|
|
@@ -599,8 +619,8 @@ export default async function handler(c: Context) {
|
|
|
599
619
|
\u3053\u306E\u30B3\u30CD\u30AF\u30BF\u306E\u30D3\u30B8\u30CD\u30B9\u30ED\u30B8\u30C3\u30AF\u30BF\u30A4\u30D7\u306F "typescript" \u3067\u3059\u3002\u30CF\u30F3\u30C9\u30E9\u5185\u3067\u306F\u30B3\u30CD\u30AF\u30BFSDK\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u74B0\u5883\u5909\u6570\u304B\u3089\u8A8D\u8A3C\u60C5\u5831\u3092\u8AAD\u307F\u53D6\u3089\u306A\u3044\u3067\u304F\u3060\u3055\u3044\u3002
|
|
600
620
|
|
|
601
621
|
SDK\u30E1\u30BD\u30C3\u30C9 (\`connection(connectionId)\` \u3067\u4F5C\u6210\u3057\u305F\u30AF\u30E9\u30A4\u30A2\u30F3\u30C8):
|
|
602
|
-
- \`client.graphql(query, variables?)\` \u2014 \u4EFB\u610F\u306EGraphQL\u30AF\u30A8\u30EA/\u30DF\u30E5\u30FC\u30C6\u30FC\u30B7\u30E7\u30F3\u3092\u9001\u4FE1\
|
|
603
|
-
- \`client.request(init?)\` \u2014 GraphQL\u30A8\u30F3\u30C9\u30DD\u30A4\u30F3\u30C8\u3078\u306E\u4F4E\u30EC\u30D9\u30EB\u8A8D\u8A3C\u4ED8\u304Dfetch
|
|
622
|
+
- \`client.graphql(query, variables?)\` \u2014 \u4EFB\u610F\u306EGraphQL\u30AF\u30A8\u30EA/\u30DF\u30E5\u30FC\u30C6\u30FC\u30B7\u30E7\u30F3\u3092\u9001\u4FE1\u3002**\u623B\u308A\u5024\u306F GraphQL \u30EC\u30B9\u30DD\u30F3\u30B9\u306E \`data\` \u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u65E2\u306B\u30A2\u30F3\u30E9\u30C3\u30D7\u3057\u305F\u3082\u306E**\u3002\`{ boards { ... } }\` \u3092\u6295\u3052\u305F\u5834\u5408\u306E\u623B\u308A\u5024\u306F \`{ boards: [...] }\` \u3067\u3042\u308A\u3001\`{ data: { boards: [...] } }\` \u3067\u306F\u306A\u3044\u3002\`result.boards\` \u306E\u3088\u3046\u306B\u30A2\u30AF\u30BB\u30B9\u3057\u3001\`result.data.boards\` \u306E\u3088\u3046\u306B \`.data\` \u3092\u7D4C\u7531\u3057\u3066\u306F\u3044\u3051\u306A\u3044\u3002\u30A8\u30E9\u30FC\u306F\u81EA\u52D5\u3067\u4F8B\u5916\u3068\u3057\u3066\u6295\u3052\u3089\u308C\u308B\u3002
|
|
623
|
+
- \`client.request(init?)\` \u2014 GraphQL\u30A8\u30F3\u30C9\u30DD\u30A4\u30F3\u30C8\u3078\u306E\u4F4E\u30EC\u30D9\u30EB\u8A8D\u8A3C\u4ED8\u304Dfetch\uFF08\u751F\u306E \`Response\` \u3092\u8FD4\u3059\u3002\`{ data, errors }\` \u30A8\u30F3\u30D9\u30ED\u30FC\u30D7\u3092\u81EA\u5206\u3067\u30D1\u30FC\u30B9\u3059\u308B\u5FC5\u8981\u304C\u3042\u308B\uFF09
|
|
604
624
|
- \`client.me()\` \u2014 \u8A8D\u8A3C\u6E08\u307F\u30E6\u30FC\u30B6\u30FC\u3068\u30A2\u30AB\u30A6\u30F3\u30C8\u3092\u53D6\u5F97
|
|
605
625
|
- \`client.listBoards(options?)\` \u2014 ids/workspaceIds/state/page/limit \u3067\u30DC\u30FC\u30C9\u4E00\u89A7\u3092\u53D6\u5F97
|
|
606
626
|
- \`client.getBoard(boardId)\` \u2014 1\u3064\u306E\u30DC\u30FC\u30C9\u3092 columns/groups/owners/tags \u4ED8\u304D\u3067\u53D6\u5F97
|
|
@@ -629,6 +649,26 @@ export default async function handler(c: Context) {
|
|
|
629
649
|
}
|
|
630
650
|
\`\`\`
|
|
631
651
|
|
|
652
|
+
#### \`client.graphql()\` \u306E\u623B\u308A\u5024\uFF08\u3088\u304F\u3042\u308B\u9593\u9055\u3044\uFF09
|
|
653
|
+
|
|
654
|
+
\`client.graphql()\` \u306F GraphQL \u30EC\u30B9\u30DD\u30F3\u30B9\u306E \`data\` \u3092\u3059\u3067\u306B\u30A2\u30F3\u30E9\u30C3\u30D7\u3057\u3066\u3044\u308B\u3002**\u623B\u308A\u5024\u306B\u5BFE\u3057\u3066 \`.data\` \u3092\u7D4C\u7531\u3057\u3066\u306F\u3044\u3051\u306A\u3044** \u2014 \u5E38\u306B \`undefined\` \u3068\u306A\u308A\u3001\u7D50\u679C\u304C\u7121\u97F3\u3067\u7A7A\u306B\u306A\u308B\u3002
|
|
655
|
+
|
|
656
|
+
\`\`\`ts
|
|
657
|
+
// \u2705 \u6B63\u3057\u3044 \u2014 \u30D5\u30A3\u30FC\u30EB\u30C9\u306F\u30C8\u30C3\u30D7\u30EC\u30D9\u30EB\u306B\u3042\u308B
|
|
658
|
+
const res = await monday.graphql<{ boards: { items_page: { items: unknown[] } }[] }>(
|
|
659
|
+
\`query($ids: [ID!], $limit: Int) {
|
|
660
|
+
boards(ids: $ids) {
|
|
661
|
+
items_page(limit: $limit) { cursor items { id name } }
|
|
662
|
+
}
|
|
663
|
+
}\`,
|
|
664
|
+
{ ids: [boardId], limit: 100 },
|
|
665
|
+
);
|
|
666
|
+
const items = res.boards?.[0]?.items_page?.items ?? [];
|
|
667
|
+
|
|
668
|
+
// \u274C \u8AA4\u308A \u2014 \`res.data\` \u306F undefined\uFF08SDK\u304C\u65E2\u306B \`.data\` \u3092\u5265\u304C\u3057\u3066\u3044\u308B\uFF09
|
|
669
|
+
const items = res.data?.boards?.[0]?.items_page?.items; // \u5E38\u306B undefined\uFF01
|
|
670
|
+
\`\`\`
|
|
671
|
+
|
|
632
672
|
### monday.com GraphQL API \u30EA\u30D5\u30A1\u30EC\u30F3\u30B9
|
|
633
673
|
|
|
634
674
|
- \u30A8\u30F3\u30C9\u30DD\u30A4\u30F3\u30C8: \`https://api.monday.com/v2\`
|
|
@@ -479,7 +479,8 @@ The business logic type for this connector is "sql".
|
|
|
479
479
|
- Row limiting: there is **no** \`LIMIT\` keyword. Use \`FETCH FIRST n ROWS ONLY\` (12c+), \`OFFSET m ROWS FETCH NEXT n ROWS ONLY\`, or filter on the \`ROWNUM\` pseudo-column.
|
|
480
480
|
- Identifier case: unquoted identifiers are folded to upper-case at parse time. \`employees\` and \`EMPLOYEES\` resolve to the same object, but \`"employees"\` (double-quoted) is a distinct, case-sensitive name.
|
|
481
481
|
- Single-row table: use \`SELECT 1 FROM DUAL\` for connection probes \u2014 Oracle requires a \`FROM\` clause on every query.
|
|
482
|
-
- Do not terminate statements with a semicolon; the thin driver rejects trailing terminators
|
|
482
|
+
- Do not terminate statements with a semicolon; the thin driver rejects trailing terminators.
|
|
483
|
+
- Row-limit compatibility: the platform's server-logic schema inference may wrap your query as \`SELECT * FROM (<inner>) AS _sq LIMIT N\`. Oracle has no \`LIMIT\` keyword, so the connector detects this exact wrapper at \`query()\` time, executes \`<inner>\` directly, and slices the first N rows in JS. You do not need to handle this \u2014 but do not author your own \`LIMIT\` clauses; use \`FETCH FIRST N ROWS ONLY\`, \`OFFSET m ROWS FETCH NEXT N ROWS ONLY\`, or \`ROWNUM\` filters.`,
|
|
483
484
|
ja: `### \u30C4\u30FC\u30EB
|
|
484
485
|
|
|
485
486
|
- \`oracle_executeQuery\`: Oracle Database \u306B\u5BFE\u3057\u3066 SQL \u3092\u5B9F\u884C\u3057\u3001\u884C\u30C7\u30FC\u30BF\u3092\u8FD4\u3057\u307E\u3059\u3002\`USER_TABLES\` / \`USER_TAB_COLUMNS\` / \`ALL_TABLES\` \u3092\u4F7F\u3063\u305F\u30B9\u30AD\u30FC\u30DE\u63A2\u7D22\u3084\u30C7\u30FC\u30BF\u306E\u30B5\u30F3\u30D7\u30EA\u30F3\u30B0\u306B\u4F7F\u3044\u307E\u3059\u3002Oracle \u56FA\u6709\u306E\u69CB\u6587\u306F\u4E0B\u90E8\u306E\u300CSQL \u30EA\u30D5\u30A1\u30EC\u30F3\u30B9\u300D\u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044\u3002
|
|
@@ -497,7 +498,8 @@ The business logic type for this connector is "sql".
|
|
|
497
498
|
- \u884C\u6570\u5236\u9650: \`LIMIT\` \u30AD\u30FC\u30EF\u30FC\u30C9\u306F **\u5B58\u5728\u3057\u307E\u305B\u3093**\u3002\`FETCH FIRST n ROWS ONLY\`\uFF0812c\u4EE5\u964D\uFF09\u3001\`OFFSET m ROWS FETCH NEXT n ROWS ONLY\`\u3001\u307E\u305F\u306F \`ROWNUM\` \u7591\u4F3C\u5217\u3067\u30D5\u30A3\u30EB\u30BF\u3057\u3066\u304F\u3060\u3055\u3044\u3002
|
|
498
499
|
- \u8B58\u5225\u5B50\u306E\u5927\u6587\u5B57\u5C0F\u6587\u5B57: \u5F15\u7528\u7B26\u306A\u3057\u306E\u8B58\u5225\u5B50\u306F\u30D1\u30FC\u30B9\u6642\u306B\u5927\u6587\u5B57\u3078\u7573\u307F\u8FBC\u307E\u308C\u307E\u3059\u3002\`employees\` \u3068 \`EMPLOYEES\` \u306F\u540C\u3058\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u3092\u6307\u3057\u307E\u3059\u304C\u3001\`"employees"\`\uFF08\u30C0\u30D6\u30EB\u30AF\u30A9\u30FC\u30C8\uFF09\u306F\u5225\u306E case-sensitive \u306A\u540D\u524D\u3067\u3059\u3002
|
|
499
500
|
- \u5358\u4E00\u884C\u30C6\u30FC\u30D6\u30EB: \u63A5\u7D9A\u78BA\u8A8D\u306B\u306F \`SELECT 1 FROM DUAL\` \u3092\u4F7F\u7528\u3057\u307E\u3059\u3002Oracle \u306E\u30AF\u30A8\u30EA\u306B\u306F\u5FC5\u305A \`FROM\` \u7BC0\u304C\u5FC5\u8981\u3067\u3059\u3002
|
|
500
|
-
- \u30B9\u30C6\u30FC\u30C8\u30E1\u30F3\u30C8\u672B\u5C3E\u306B\u30BB\u30DF\u30B3\u30ED\u30F3\u3092\u4ED8\u3051\u306A\u3044\u3067\u304F\u3060\u3055\u3044\uFF08thin \u30C9\u30E9\u30A4\u30D0\u304C\u62D2\u5426\u3057\u307E\u3059\uFF09\u3002
|
|
501
|
+
- \u30B9\u30C6\u30FC\u30C8\u30E1\u30F3\u30C8\u672B\u5C3E\u306B\u30BB\u30DF\u30B3\u30ED\u30F3\u3092\u4ED8\u3051\u306A\u3044\u3067\u304F\u3060\u3055\u3044\uFF08thin \u30C9\u30E9\u30A4\u30D0\u304C\u62D2\u5426\u3057\u307E\u3059\uFF09\u3002
|
|
502
|
+
- \u884C\u6570\u5236\u9650\u306E\u4E92\u63DB\u6027: \u30D7\u30E9\u30C3\u30C8\u30D5\u30A9\u30FC\u30E0\u306E server-logic \u30B9\u30AD\u30FC\u30DE\u63A8\u8AD6\u306F\u3001\u30AF\u30A8\u30EA\u3092 \`SELECT * FROM (<inner>) AS _sq LIMIT N\` \u306E\u5F62\u3067\u30E9\u30C3\u30D7\u3057\u3066\u304F\u308B\u3053\u3068\u304C\u3042\u308A\u307E\u3059\u3002Oracle \u306B\u306F \`LIMIT\` \u30AD\u30FC\u30EF\u30FC\u30C9\u304C\u5B58\u5728\u3057\u306A\u3044\u305F\u3081\u3001\u30B3\u30CD\u30AF\u30BF\u306F \`query()\` \u5185\u3067\u3053\u306E\u30E9\u30C3\u30D1\u3092\u691C\u51FA\u3057\u3001\`<inner>\` \u3092\u305D\u306E\u307E\u307E\u5B9F\u884C\u3057\u3066 JS \u5074\u3067\u5148\u982D N \u884C\u306B\u5207\u308A\u8A70\u3081\u307E\u3059\u3002\u5229\u7528\u8005\u5074\u3067\u5BFE\u51E6\u3059\u308B\u5FC5\u8981\u306F\u3042\u308A\u307E\u305B\u3093\u304C\u3001\u81EA\u5206\u3067\u66F8\u304F SQL \u3067\u306F \`LIMIT\` \u3092\u4F7F\u308F\u305A \`FETCH FIRST N ROWS ONLY\` / \`OFFSET m ROWS FETCH NEXT N ROWS ONLY\` / \`ROWNUM\` \u3092\u4F7F\u3063\u3066\u304F\u3060\u3055\u3044\u3002`
|
|
501
503
|
},
|
|
502
504
|
tools,
|
|
503
505
|
async checkConnection(params, _config) {
|
|
@@ -511,6 +513,15 @@ The business logic type for this connector is "sql".
|
|
|
511
513
|
username: params[parameters.username.slug],
|
|
512
514
|
password: params[parameters.password.slug]
|
|
513
515
|
});
|
|
516
|
+
const wrapper = sql.match(
|
|
517
|
+
/^\s*SELECT\s+\*\s+FROM\s+\(([\s\S]+)\)\s+AS\s+_sq\s+LIMIT\s+(\d+)\s*;?\s*$/i
|
|
518
|
+
);
|
|
519
|
+
if (wrapper) {
|
|
520
|
+
const inner = wrapper[1].trim().replace(/;\s*$/, "");
|
|
521
|
+
const limit = Number.parseInt(wrapper[2], 10);
|
|
522
|
+
const result = await runOracleQuery(parsed, inner);
|
|
523
|
+
return { rows: result.rows.slice(0, limit) };
|
|
524
|
+
}
|
|
514
525
|
const cleanSql = sql.replace(/;\s*$/, "");
|
|
515
526
|
return runOracleQuery(parsed, cleanSql);
|
|
516
527
|
}
|
|
@@ -470,7 +470,8 @@ The business logic type for this connector is "sql".
|
|
|
470
470
|
- List columns: \`SELECT COLUMN_NAME, DATA_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = 'dbo' AND TABLE_NAME = 'xxx'\`
|
|
471
471
|
- Use \`TOP n\` instead of \`LIMIT n\` (e.g. \`SELECT TOP 100 * FROM ...\`).
|
|
472
472
|
- Identifiers can be quoted with square brackets, e.g. \`[Order Details]\`.
|
|
473
|
-
- Always bound results with \`TOP\` in queries
|
|
473
|
+
- Always bound results with \`TOP\` in queries.
|
|
474
|
+
- Row-limit compatibility: the platform's server-logic schema inference may wrap your query as \`SELECT * FROM (<inner>) AS _sq LIMIT N\`. T-SQL does not understand \`LIMIT\`, so the connector detects this exact wrapper at \`query()\` time, executes \`<inner>\` directly, and slices the first N rows in JS. You do not need to handle this \u2014 but do not author your own \`LIMIT\` clauses; use \`TOP\` / \`OFFSET ... FETCH NEXT\` in queries you write.`,
|
|
474
475
|
ja: `### \u30C4\u30FC\u30EB
|
|
475
476
|
|
|
476
477
|
- \`sqlserver_executeQuery\`: Microsoft SQL Server \u306B\u5BFE\u3057\u3066 T-SQL \u30AF\u30A8\u30EA\u3092\u5B9F\u884C\u3057\u3001\u884C\u30C7\u30FC\u30BF\u3092\u8FD4\u3057\u307E\u3059\u3002\`INFORMATION_SCHEMA\` \u3092\u4F7F\u3063\u305F\u30B9\u30AD\u30FC\u30DE\u63A2\u7D22\u3084\u30C7\u30FC\u30BF\u306E\u30B5\u30F3\u30D7\u30EA\u30F3\u30B0\u306B\u4F7F\u3044\u307E\u3059\u3002SQL Server \u56FA\u6709\u306E\u69CB\u6587\u306F\u4E0B\u90E8\u306E\u300CSQL \u30EA\u30D5\u30A1\u30EC\u30F3\u30B9\u300D\u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044\u3002
|
|
@@ -486,7 +487,8 @@ The business logic type for this connector is "sql".
|
|
|
486
487
|
- \u30AB\u30E9\u30E0\u4E00\u89A7: \`SELECT COLUMN_NAME, DATA_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = 'dbo' AND TABLE_NAME = 'xxx'\`
|
|
487
488
|
- \`LIMIT n\` \u3067\u306F\u306A\u304F \`TOP n\` \u3092\u4F7F\u7528\u3057\u307E\u3059\uFF08\u4F8B: \`SELECT TOP 100 * FROM ...\`\uFF09\u3002
|
|
488
489
|
- \u8B58\u5225\u5B50\u306F\u89D2\u62EC\u5F27\u3067\u56F2\u3081\u307E\u3059\uFF08\u4F8B: \`[Order Details]\`\uFF09\u3002
|
|
489
|
-
- \u7D50\u679C\u4EF6\u6570\u306F\u5FC5\u305A \`TOP\` \u3067\u5236\u9650\u3057\u3066\u304F\u3060\u3055\u3044\u3002
|
|
490
|
+
- \u7D50\u679C\u4EF6\u6570\u306F\u5FC5\u305A \`TOP\` \u3067\u5236\u9650\u3057\u3066\u304F\u3060\u3055\u3044\u3002
|
|
491
|
+
- \u884C\u6570\u5236\u9650\u306E\u4E92\u63DB\u6027: \u30D7\u30E9\u30C3\u30C8\u30D5\u30A9\u30FC\u30E0\u306E server-logic \u30B9\u30AD\u30FC\u30DE\u63A8\u8AD6\u306F\u3001\u30AF\u30A8\u30EA\u3092 \`SELECT * FROM (<inner>) AS _sq LIMIT N\` \u306E\u5F62\u3067\u30E9\u30C3\u30D7\u3057\u3066\u304F\u308B\u3053\u3068\u304C\u3042\u308A\u307E\u3059\u3002T-SQL \u306B\u306F \`LIMIT\` \u304C\u7121\u3044\u305F\u3081\u3001\u30B3\u30CD\u30AF\u30BF\u306F \`query()\` \u5185\u3067\u3053\u306E\u30E9\u30C3\u30D1\u3092\u691C\u51FA\u3057\u3001\`<inner>\` \u3092\u305D\u306E\u307E\u307E\u5B9F\u884C\u3057\u3066 JS \u5074\u3067\u5148\u982D N \u884C\u306B\u5207\u308A\u8A70\u3081\u307E\u3059\u3002\u5229\u7528\u8005\u5074\u3067\u5BFE\u51E6\u3059\u308B\u5FC5\u8981\u306F\u3042\u308A\u307E\u305B\u3093\u304C\u3001\u81EA\u5206\u3067\u66F8\u304F SQL \u3067\u306F \`LIMIT\` \u3092\u4F7F\u308F\u305A \`TOP\` / \`OFFSET ... FETCH NEXT\` \u3092\u4F7F\u3063\u3066\u304F\u3060\u3055\u3044\u3002`
|
|
490
492
|
},
|
|
491
493
|
tools,
|
|
492
494
|
async checkConnection(params, _config) {
|
|
@@ -503,6 +505,15 @@ The business logic type for this connector is "sql".
|
|
|
503
505
|
username: params[parameters.username.slug],
|
|
504
506
|
password: params[parameters.password.slug]
|
|
505
507
|
});
|
|
508
|
+
const wrapper = sql.match(
|
|
509
|
+
/^\s*SELECT\s+\*\s+FROM\s+\(([\s\S]+)\)\s+AS\s+_sq\s+LIMIT\s+(\d+)\s*;?\s*$/i
|
|
510
|
+
);
|
|
511
|
+
if (wrapper) {
|
|
512
|
+
const inner = wrapper[1].trim();
|
|
513
|
+
const limit = Number.parseInt(wrapper[2], 10);
|
|
514
|
+
const result = await runMssqlQuery(parsed, inner);
|
|
515
|
+
return { rows: result.rows.slice(0, limit) };
|
|
516
|
+
}
|
|
506
517
|
return runMssqlQuery(parsed, sql);
|
|
507
518
|
}
|
|
508
519
|
});
|
|
@@ -353,7 +353,7 @@ var supabaseConnector = new ConnectorPlugin({
|
|
|
353
353
|
description: "Connect to a Supabase project's Postgres database to query application tables and Supabase-managed schemas (auth, storage).",
|
|
354
354
|
iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/14k0U6F9PVovVjYjWyNzKb/2c4ff53adbe9334a63fee0a13d9f050a/supabase-icon.webp",
|
|
355
355
|
parameters,
|
|
356
|
-
releaseFlag: { dev1: true, dev2:
|
|
356
|
+
releaseFlag: { dev1: true, dev2: true, prod: true },
|
|
357
357
|
categories: ["database"],
|
|
358
358
|
onboarding: supabaseOnboarding,
|
|
359
359
|
systemPrompt: {
|