@squadbase/connectors 0.0.14 → 0.0.16
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.js +80 -50
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -165,6 +165,7 @@ var snowflakeSetup = new ConnectorSetup({
|
|
|
165
165
|
- \`{schema}\uFF08\u7279\u5B9A\u30C6\u30FC\u30D6\u30EB\u3092\u9078\u629E\uFF09\` \u2014 description: "{database}.{schema} \u5185\u306E\u7279\u5B9A\u30C6\u30FC\u30D6\u30EB\u306E\u307F\u4F7F\u7528"
|
|
166
166
|
- \u30B9\u30AD\u30FC\u30DE\u304C1\u3064\u3060\u3051\u306E\u5834\u5408\u3082\u3001\u300C\u5168\u30C6\u30FC\u30D6\u30EB\u300D\u3068\u300C\u7279\u5B9A\u30C6\u30FC\u30D6\u30EB\u3092\u9078\u629E\u300D\u306E2\u3064\u306E\u9078\u629E\u80A2\u3092\u63D0\u793A\u3059\u308B\u3053\u3068
|
|
167
167
|
|
|
168
|
+
|
|
168
169
|
#### \u30B9\u30C6\u30C3\u30D73: \u30C6\u30FC\u30D6\u30EB\u9078\u629E\uFF08\u300C\u7279\u5B9A\u30C6\u30FC\u30D6\u30EB\u3092\u9078\u629E\u300D\u304C\u9078\u3070\u308C\u305F\u30B9\u30AD\u30FC\u30DE\u306E\u307F\uFF09
|
|
169
170
|
6. \u300C\u5168\u30C6\u30FC\u30D6\u30EB\u300D\u304C\u9078\u3070\u308C\u305F\u30B9\u30AD\u30FC\u30DE\u306F\u30C6\u30FC\u30D6\u30EB\u9078\u629E\u3092\u30B9\u30AD\u30C3\u30D7\u3057\u3001\u5168\u30C6\u30FC\u30D6\u30EB\u3092\u5BFE\u8C61\u3068\u3059\u308B
|
|
170
171
|
7. \u300C\u7279\u5B9A\u30C6\u30FC\u30D6\u30EB\u3092\u9078\u629E\u300D\u304C\u9078\u3070\u308C\u305F\u30B9\u30AD\u30FC\u30DE\u306B\u5BFE\u3057\u3066\u306E\u307F \`SHOW TABLES IN SCHEMA {database}.{schema}\` \u3092\u5B9F\u884C\u3057\u3066\u30C6\u30FC\u30D6\u30EB\u4E00\u89A7\u3092\u53D6\u5F97\u3059\u308B
|
|
@@ -206,6 +207,7 @@ Follow these steps to set up the Snowflake connection.
|
|
|
206
207
|
- \`{schema} (select specific tables)\` \u2014 description: "Use only specific tables in {database}.{schema}"
|
|
207
208
|
- Even if there is only 1 schema, present both "all tables" and "select specific tables" options
|
|
208
209
|
|
|
210
|
+
|
|
209
211
|
#### Step 3: Table Selection (only for schemas where "select specific tables" was chosen)
|
|
210
212
|
6. For schemas where "all tables" was chosen, skip table selection and include all tables
|
|
211
213
|
7. For schemas where "select specific tables" was chosen, run \`SHOW TABLES IN SCHEMA {database}.{schema}\` to get the table list
|
|
@@ -234,7 +236,7 @@ var parameters7 = {
|
|
|
234
236
|
account: new ParameterDefinition({
|
|
235
237
|
slug: "account",
|
|
236
238
|
name: "Snowflake Account",
|
|
237
|
-
description: "The Snowflake account identifier (e.g., xy12345
|
|
239
|
+
description: "The Snowflake account identifier in ORGNAME-ACCOUNTNAME format (e.g., myorg-xy12345).",
|
|
238
240
|
envVarBaseKey: "SNOWFLAKE_ACCOUNT",
|
|
239
241
|
type: "text",
|
|
240
242
|
secret: false,
|
|
@@ -519,7 +521,7 @@ var parameters8 = {
|
|
|
519
521
|
account: new ParameterDefinition({
|
|
520
522
|
slug: "account",
|
|
521
523
|
name: "Snowflake Account",
|
|
522
|
-
description: "The Snowflake account identifier (e.g., xy12345
|
|
524
|
+
description: "The Snowflake account identifier in ORGNAME-ACCOUNTNAME format (e.g., myorg-xy12345).",
|
|
523
525
|
envVarBaseKey: "SNOWFLAKE_ACCOUNT",
|
|
524
526
|
type: "text",
|
|
525
527
|
secret: false,
|
|
@@ -1144,28 +1146,35 @@ var bigquerySetup = new ConnectorSetup({
|
|
|
1144
1146
|
|
|
1145
1147
|
#### \u30B9\u30C6\u30C3\u30D71: \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u9078\u629E
|
|
1146
1148
|
1. \`${listProjectsToolName}\` \u3092\u547C\u3073\u51FA\u3057\u3066\u3001\u30B5\u30FC\u30D3\u30B9\u30A2\u30AB\u30A6\u30F3\u30C8\u304C\u30A2\u30AF\u30BB\u30B9\u53EF\u80FD\u306AGCP\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u4E00\u89A7\u3092\u53D6\u5F97\u3059\u308B
|
|
1147
|
-
2. \`updateConnectionParameters\` \u3092\u547C\u3073\u51FA\u3059:
|
|
1149
|
+
2. \u300C\u30D1\u30D6\u30EA\u30C3\u30AF\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u3092\u4F7F\u3046\u5834\u5408\u3082\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u3092\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044\u300D\u3068\u30E6\u30FC\u30B6\u30FC\u306B\u4F1D\u3048\u305F\u4E0A\u3067\u3001\`updateConnectionParameters\` \u3092\u547C\u3073\u51FA\u3059:
|
|
1148
1150
|
- \`parameterSlug\`: \`"project-id"\`
|
|
1149
|
-
- \`options\`: \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u4E00\u89A7
|
|
1151
|
+
- \`options\`: \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u4E00\u89A7\u3002\u5404 option \u306E \`label\` \u306F \`\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u540D (id: \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8ID)\` \u306E\u5F62\u5F0F\u3001\`value\` \u306F\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8ID
|
|
1150
1152
|
3. \u30E6\u30FC\u30B6\u30FC\u304C\u9078\u629E\u3057\u305F\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306E \`label\` \u304C\u30E1\u30C3\u30BB\u30FC\u30B8\u3068\u3057\u3066\u5C4A\u304F\u306E\u3067\u3001\u30B9\u30C6\u30C3\u30D72\u306B\u9032\u3080
|
|
1151
1153
|
|
|
1152
1154
|
#### \u30B9\u30C6\u30C3\u30D72: \u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u9078\u629E
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1155
|
+
1. \`SELECT schema_name FROM INFORMATION_SCHEMA.SCHEMATA\` \u3092\u5B9F\u884C\u3057\u3066\u3001\u9078\u629E\u3055\u308C\u305F\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u5185\u306E\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u4E00\u89A7\u3092\u53D6\u5F97\u3059\u308B
|
|
1156
|
+
2. \`askUserQuestion\` \u3092\u547C\u3073\u51FA\u3059\uFF08multiSelect: true\uFF09:
|
|
1157
|
+
- \`question\`: \u4F7F\u7528\u3059\u308B\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u3092\u9078\u629E\u3059\u308B\u3088\u3046\u4FC3\u3059\u3002\u300C\u4E0A\u8A18\u4EE5\u5916\u306E\u30D1\u30D6\u30EA\u30C3\u30AF\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u306F \`bigquery-public-data.{\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u540D}\` \u306E\u5F62\u5F0F\u3067\u81EA\u7531\u5165\u529B\u3067\u304D\u307E\u3059\u300D\u3068\u660E\u8A18\u3059\u308B
|
|
1158
|
+
- \`options\`: \u4EE5\u4E0B\u3092\u9806\u756A\u306B\u7D50\u5408\u3059\u308B
|
|
1159
|
+
1. \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u5185\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8: \u5404 \`{ label: schema_name, description: schema_name }\`
|
|
1160
|
+
2. \u30D1\u30D6\u30EA\u30C3\u30AF\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\uFF08\u56FA\u5B9A\u3067\u672B\u5C3E\u306B\u8FFD\u52A0\uFF09:
|
|
1161
|
+
- \`{ label: "bigquery-public-data.thelook_ecommerce", description: "EC\u30B5\u30A4\u30C8\u306E\u30C7\u30E2\u30C7\u30FC\u30BF" }\`
|
|
1162
|
+
- \`{ label: "bigquery-public-data.google_analytics_sample", description: "Google Analytics \u30B5\u30F3\u30D7\u30EB" }\`
|
|
1163
|
+
- \`{ label: "bigquery-public-data.austin_311", description: "\u30AB\u30B9\u30BF\u30DE\u30FC\u30B5\u30FC\u30D3\u30B9\u30EA\u30AF\u30A8\u30B9\u30C8\u30C7\u30FC\u30BF" }\`
|
|
1164
|
+
- **\u6CE8\u610F**: \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u5185\u306E\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u304C0\u4EF6\u30841\u4EF6\u3067\u3082\u3001\u30D1\u30D6\u30EA\u30C3\u30AF\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u306E\u9078\u629E\u80A2\u304C\u3042\u308B\u305F\u3081 askUserQuestion \u3092\u7701\u7565\u3057\u306A\u3044\u3053\u3068
|
|
1159
1165
|
|
|
1160
1166
|
#### \u30B9\u30C6\u30C3\u30D73: \u30C6\u30FC\u30D6\u30EB\u9078\u629E
|
|
1161
|
-
|
|
1162
|
-
|
|
1167
|
+
1. \u9078\u629E\u3055\u308C\u305F\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u3054\u3068\u306B\u30C6\u30FC\u30D6\u30EB\u4E00\u89A7\u3092\u53D6\u5F97\u3059\u308B\u3002\u30AF\u30A8\u30EA\u306F\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u306E\u7A2E\u985E\u3067\u7570\u306A\u308B:
|
|
1168
|
+
- \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u5185\u306E\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8: \`SELECT table_name FROM \\\`{project}.{dataset}.INFORMATION_SCHEMA.TABLES\\\`\`
|
|
1169
|
+
- \u30D1\u30D6\u30EA\u30C3\u30AF\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\uFF08\`bigquery-public-data.*\`\uFF09: \`SELECT table_name FROM \\\`bigquery-public-data.{dataset}.INFORMATION_SCHEMA.TABLES\\\`\`
|
|
1170
|
+
- \u8907\u6570\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u306E\u5834\u5408\u306F UNION ALL \u3067\u4E00\u62EC\u53D6\u5F97
|
|
1171
|
+
2. \u7D50\u679C\u306B\u5FDC\u3058\u3066\u5206\u5C90:
|
|
1163
1172
|
- **\u30C6\u30FC\u30D6\u30EB\u304C2\u3064\u4EE5\u4E0A**: \`askUserQuestion\`\uFF08multiSelect: true\uFF09\u3067\u30E6\u30FC\u30B6\u30FC\u306B\u63D0\u793A\u3057\u3001\u4F7F\u7528\u3059\u308B\u30C6\u30FC\u30D6\u30EB\u3092\u9078\u629E\u3055\u305B\u308B\u3002description \u306B\u306F\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u540D\u3092\u8A18\u8F09\u3059\u308B
|
|
1164
1173
|
- **\u30C6\u30FC\u30D6\u30EB\u304C1\u3064\u3060\u3051**: askUserQuestion \u306F\u4F7F\u308F\u305A\u81EA\u52D5\u63A1\u7528
|
|
1165
1174
|
|
|
1166
1175
|
#### \u30B9\u30C6\u30C3\u30D74: \u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u5B8C\u4E86
|
|
1167
|
-
|
|
1168
|
-
- \`dataset\`: \u9078\u629E\u3055\u308C\u305F\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u540D\uFF08\u8907\u6570\u306E\u5834\u5408\u306F\u30AB\u30F3\u30DE\u533A\u5207\u308A\uFF09
|
|
1176
|
+
1. \`updateConnectionContext\` \u3092\u547C\u3073\u51FA\u3059:
|
|
1177
|
+
- \`dataset\`: \u9078\u629E\u3055\u308C\u305F\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u540D\uFF08\u8907\u6570\u306E\u5834\u5408\u306F\u30AB\u30F3\u30DE\u533A\u5207\u308A\uFF09\u3002\u30D1\u30D6\u30EA\u30C3\u30AF\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u306F \`bigquery-public-data.{dataset}\` \u306E\u5F62\u5F0F\u3067\u8A18\u9332\u3059\u308B
|
|
1169
1178
|
- \`tables\`: \u9078\u629E\u3055\u308C\u305F\u30C6\u30FC\u30D6\u30EB\u540D\uFF08\u8907\u6570\u306E\u5834\u5408\u306F\u30AB\u30F3\u30DE\u533A\u5207\u308A\uFF09
|
|
1170
1179
|
- \`note\`: \u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u5185\u5BB9\u306E\u7C21\u5358\u306A\u8AAC\u660E
|
|
1171
1180
|
|
|
@@ -1183,28 +1192,35 @@ Follow these steps to set up the BigQuery connection.
|
|
|
1183
1192
|
|
|
1184
1193
|
#### Step 1: Project Selection
|
|
1185
1194
|
1. Call \`${listProjectsToolName}\` to get the list of GCP projects accessible with the service account credentials
|
|
1186
|
-
2.
|
|
1195
|
+
2. Tell the user "Please select a project even if you plan to use public datasets", then call \`updateConnectionParameters\`:
|
|
1187
1196
|
- \`parameterSlug\`: \`"project-id"\`
|
|
1188
|
-
- \`options\`: The project list
|
|
1197
|
+
- \`options\`: The project list. Each option's \`label\` should be \`Project Name (id: project-id)\`, \`value\` should be the project ID
|
|
1189
1198
|
3. The \`label\` of the user's selected project will arrive as a message. Proceed to Step 2
|
|
1190
1199
|
|
|
1191
1200
|
#### Step 2: Dataset Selection
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1201
|
+
1. Run \`SELECT schema_name FROM INFORMATION_SCHEMA.SCHEMATA\` to get the list of datasets in the selected project
|
|
1202
|
+
2. Call \`askUserQuestion\` (multiSelect: true):
|
|
1203
|
+
- \`question\`: Ask the user to select datasets. State that other public datasets can be entered freely in the format \`bigquery-public-data.{dataset_name}\`
|
|
1204
|
+
- \`options\`: Concatenate in order:
|
|
1205
|
+
1. Project datasets: each \`{ label: schema_name, description: schema_name }\`
|
|
1206
|
+
2. Public datasets (always append at the end):
|
|
1207
|
+
- \`{ label: "bigquery-public-data.thelook_ecommerce", description: "E-commerce demo data" }\`
|
|
1208
|
+
- \`{ label: "bigquery-public-data.google_analytics_sample", description: "Google Analytics sample" }\`
|
|
1209
|
+
- \`{ label: "bigquery-public-data.austin_311", description: "Customer service request data" }\`
|
|
1210
|
+
- **Important**: Do NOT skip askUserQuestion even if the project has 0 or 1 datasets, because public dataset options are always available
|
|
1198
1211
|
|
|
1199
1212
|
#### Step 3: Table Selection
|
|
1200
|
-
|
|
1201
|
-
|
|
1213
|
+
1. Retrieve the table list for each selected dataset. The query differs by dataset type:
|
|
1214
|
+
- Project datasets: \`SELECT table_name FROM \\\`{project}.{dataset}.INFORMATION_SCHEMA.TABLES\\\`\`
|
|
1215
|
+
- Public datasets (\`bigquery-public-data.*\`): \`SELECT table_name FROM \\\`bigquery-public-data.{dataset}.INFORMATION_SCHEMA.TABLES\\\`\`
|
|
1216
|
+
- Use UNION ALL for multiple datasets
|
|
1217
|
+
2. Branch based on results:
|
|
1202
1218
|
- **2 or more tables**: Present them to the user via \`askUserQuestion\` (multiSelect: true) and let them select which tables to use. Include the dataset name in the description
|
|
1203
1219
|
- **Exactly 1 table**: Do NOT call askUserQuestion. Auto-select it
|
|
1204
1220
|
|
|
1205
1221
|
#### Step 4: Complete Setup
|
|
1206
|
-
|
|
1207
|
-
- \`dataset\`: Selected dataset name(s) (comma-separated if multiple)
|
|
1222
|
+
1. Call \`updateConnectionContext\`:
|
|
1223
|
+
- \`dataset\`: Selected dataset name(s) (comma-separated if multiple). Record public datasets in the format \`bigquery-public-data.{dataset}\`
|
|
1208
1224
|
- \`tables\`: Selected table name(s) (comma-separated if multiple)
|
|
1209
1225
|
- \`note\`: Brief description of the setup
|
|
1210
1226
|
|
|
@@ -1453,28 +1469,35 @@ var bigquerySetup2 = new ConnectorSetup({
|
|
|
1453
1469
|
|
|
1454
1470
|
#### \u30B9\u30C6\u30C3\u30D71: \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u9078\u629E
|
|
1455
1471
|
1. \`${listProjectsToolName2}\` \u3092\u547C\u3073\u51FA\u3057\u3066\u3001OAuth\u3067\u30A2\u30AF\u30BB\u30B9\u53EF\u80FD\u306AGCP\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u4E00\u89A7\u3092\u53D6\u5F97\u3059\u308B
|
|
1456
|
-
2. \`updateConnectionParameters\` \u3092\u547C\u3073\u51FA\u3059:
|
|
1472
|
+
2. \u300C\u30D1\u30D6\u30EA\u30C3\u30AF\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u3092\u4F7F\u3046\u5834\u5408\u3082\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u3092\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044\u300D\u3068\u30E6\u30FC\u30B6\u30FC\u306B\u4F1D\u3048\u305F\u4E0A\u3067\u3001\`updateConnectionParameters\` \u3092\u547C\u3073\u51FA\u3059:
|
|
1457
1473
|
- \`parameterSlug\`: \`"project-id"\`
|
|
1458
|
-
- \`options\`: \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u4E00\u89A7
|
|
1474
|
+
- \`options\`: \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u4E00\u89A7\u3002\u5404 option \u306E \`label\` \u306F \`\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u540D (id: \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8ID)\` \u306E\u5F62\u5F0F\u3001\`value\` \u306F\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8ID
|
|
1459
1475
|
3. \u30E6\u30FC\u30B6\u30FC\u304C\u9078\u629E\u3057\u305F\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306E \`label\` \u304C\u30E1\u30C3\u30BB\u30FC\u30B8\u3068\u3057\u3066\u5C4A\u304F\u306E\u3067\u3001\u30B9\u30C6\u30C3\u30D72\u306B\u9032\u3080
|
|
1460
1476
|
|
|
1461
1477
|
#### \u30B9\u30C6\u30C3\u30D72: \u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u9078\u629E
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1478
|
+
1. \`SELECT schema_name FROM INFORMATION_SCHEMA.SCHEMATA\` \u3092\u5B9F\u884C\u3057\u3066\u3001\u9078\u629E\u3055\u308C\u305F\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u5185\u306E\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u4E00\u89A7\u3092\u53D6\u5F97\u3059\u308B
|
|
1479
|
+
2. \`askUserQuestion\` \u3092\u547C\u3073\u51FA\u3059\uFF08multiSelect: true\uFF09:
|
|
1480
|
+
- \`question\`: \u4F7F\u7528\u3059\u308B\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u3092\u9078\u629E\u3059\u308B\u3088\u3046\u4FC3\u3059\u3002\u300C\u4E0A\u8A18\u4EE5\u5916\u306E\u30D1\u30D6\u30EA\u30C3\u30AF\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u306F \`bigquery-public-data.{\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u540D}\` \u306E\u5F62\u5F0F\u3067\u81EA\u7531\u5165\u529B\u3067\u304D\u307E\u3059\u300D\u3068\u660E\u8A18\u3059\u308B
|
|
1481
|
+
- \`options\`: \u4EE5\u4E0B\u3092\u9806\u756A\u306B\u7D50\u5408\u3059\u308B
|
|
1482
|
+
1. \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u5185\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8: \u5404 \`{ label: schema_name, description: schema_name }\`
|
|
1483
|
+
2. \u30D1\u30D6\u30EA\u30C3\u30AF\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\uFF08\u56FA\u5B9A\u3067\u672B\u5C3E\u306B\u8FFD\u52A0\uFF09:
|
|
1484
|
+
- \`{ label: "bigquery-public-data.thelook_ecommerce", description: "EC\u30B5\u30A4\u30C8\u306E\u30C7\u30E2\u30C7\u30FC\u30BF" }\`
|
|
1485
|
+
- \`{ label: "bigquery-public-data.google_analytics_sample", description: "Google Analytics \u30B5\u30F3\u30D7\u30EB" }\`
|
|
1486
|
+
- \`{ label: "bigquery-public-data.austin_311", description: "\u30AB\u30B9\u30BF\u30DE\u30FC\u30B5\u30FC\u30D3\u30B9\u30EA\u30AF\u30A8\u30B9\u30C8\u30C7\u30FC\u30BF" }\`
|
|
1487
|
+
- **\u6CE8\u610F**: \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u5185\u306E\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u304C0\u4EF6\u30841\u4EF6\u3067\u3082\u3001\u30D1\u30D6\u30EA\u30C3\u30AF\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u306E\u9078\u629E\u80A2\u304C\u3042\u308B\u305F\u3081 askUserQuestion \u3092\u7701\u7565\u3057\u306A\u3044\u3053\u3068
|
|
1468
1488
|
|
|
1469
1489
|
#### \u30B9\u30C6\u30C3\u30D73: \u30C6\u30FC\u30D6\u30EB\u9078\u629E
|
|
1470
|
-
|
|
1471
|
-
|
|
1490
|
+
1. \u9078\u629E\u3055\u308C\u305F\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u3054\u3068\u306B\u30C6\u30FC\u30D6\u30EB\u4E00\u89A7\u3092\u53D6\u5F97\u3059\u308B\u3002\u30AF\u30A8\u30EA\u306F\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u306E\u7A2E\u985E\u3067\u7570\u306A\u308B:
|
|
1491
|
+
- \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u5185\u306E\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8: \`SELECT table_name FROM \\\`{project}.{dataset}.INFORMATION_SCHEMA.TABLES\\\`\`
|
|
1492
|
+
- \u30D1\u30D6\u30EA\u30C3\u30AF\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\uFF08\`bigquery-public-data.*\`\uFF09: \`SELECT table_name FROM \\\`bigquery-public-data.{dataset}.INFORMATION_SCHEMA.TABLES\\\`\`
|
|
1493
|
+
- \u8907\u6570\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u306E\u5834\u5408\u306F UNION ALL \u3067\u4E00\u62EC\u53D6\u5F97
|
|
1494
|
+
2. \u7D50\u679C\u306B\u5FDC\u3058\u3066\u5206\u5C90:
|
|
1472
1495
|
- **\u30C6\u30FC\u30D6\u30EB\u304C2\u3064\u4EE5\u4E0A**: \`askUserQuestion\`\uFF08multiSelect: true\uFF09\u3067\u30E6\u30FC\u30B6\u30FC\u306B\u63D0\u793A\u3057\u3001\u4F7F\u7528\u3059\u308B\u30C6\u30FC\u30D6\u30EB\u3092\u9078\u629E\u3055\u305B\u308B\u3002description \u306B\u306F\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u540D\u3092\u8A18\u8F09\u3059\u308B
|
|
1473
1496
|
- **\u30C6\u30FC\u30D6\u30EB\u304C1\u3064\u3060\u3051**: askUserQuestion \u306F\u4F7F\u308F\u305A\u81EA\u52D5\u63A1\u7528
|
|
1474
1497
|
|
|
1475
1498
|
#### \u30B9\u30C6\u30C3\u30D74: \u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u5B8C\u4E86
|
|
1476
|
-
|
|
1477
|
-
- \`dataset\`: \u9078\u629E\u3055\u308C\u305F\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u540D\uFF08\u8907\u6570\u306E\u5834\u5408\u306F\u30AB\u30F3\u30DE\u533A\u5207\u308A\uFF09
|
|
1499
|
+
1. \`updateConnectionContext\` \u3092\u547C\u3073\u51FA\u3059:
|
|
1500
|
+
- \`dataset\`: \u9078\u629E\u3055\u308C\u305F\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u540D\uFF08\u8907\u6570\u306E\u5834\u5408\u306F\u30AB\u30F3\u30DE\u533A\u5207\u308A\uFF09\u3002\u30D1\u30D6\u30EA\u30C3\u30AF\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u306F \`bigquery-public-data.{dataset}\` \u306E\u5F62\u5F0F\u3067\u8A18\u9332\u3059\u308B
|
|
1478
1501
|
- \`tables\`: \u9078\u629E\u3055\u308C\u305F\u30C6\u30FC\u30D6\u30EB\u540D\uFF08\u8907\u6570\u306E\u5834\u5408\u306F\u30AB\u30F3\u30DE\u533A\u5207\u308A\uFF09
|
|
1479
1502
|
- \`note\`: \u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u5185\u5BB9\u306E\u7C21\u5358\u306A\u8AAC\u660E
|
|
1480
1503
|
|
|
@@ -1492,28 +1515,35 @@ Follow these steps to set up the BigQuery connection.
|
|
|
1492
1515
|
|
|
1493
1516
|
#### Step 1: Project Selection
|
|
1494
1517
|
1. Call \`${listProjectsToolName2}\` to get the list of GCP projects accessible with the OAuth credentials
|
|
1495
|
-
2.
|
|
1518
|
+
2. Tell the user "Please select a project even if you plan to use public datasets", then call \`updateConnectionParameters\`:
|
|
1496
1519
|
- \`parameterSlug\`: \`"project-id"\`
|
|
1497
|
-
- \`options\`: The project list
|
|
1520
|
+
- \`options\`: The project list. Each option's \`label\` should be \`Project Name (id: project-id)\`, \`value\` should be the project ID
|
|
1498
1521
|
3. The \`label\` of the user's selected project will arrive as a message. Proceed to Step 2
|
|
1499
1522
|
|
|
1500
1523
|
#### Step 2: Dataset Selection
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1524
|
+
1. Run \`SELECT schema_name FROM INFORMATION_SCHEMA.SCHEMATA\` to get the list of datasets in the selected project
|
|
1525
|
+
2. Call \`askUserQuestion\` (multiSelect: true):
|
|
1526
|
+
- \`question\`: Ask the user to select datasets. State that other public datasets can be entered freely in the format \`bigquery-public-data.{dataset_name}\`
|
|
1527
|
+
- \`options\`: Concatenate in order:
|
|
1528
|
+
1. Project datasets: each \`{ label: schema_name, description: schema_name }\`
|
|
1529
|
+
2. Public datasets (always append at the end):
|
|
1530
|
+
- \`{ label: "bigquery-public-data.thelook_ecommerce", description: "E-commerce demo data" }\`
|
|
1531
|
+
- \`{ label: "bigquery-public-data.google_analytics_sample", description: "Google Analytics sample" }\`
|
|
1532
|
+
- \`{ label: "bigquery-public-data.austin_311", description: "Customer service request data" }\`
|
|
1533
|
+
- **Important**: Do NOT skip askUserQuestion even if the project has 0 or 1 datasets, because public dataset options are always available
|
|
1507
1534
|
|
|
1508
1535
|
#### Step 3: Table Selection
|
|
1509
|
-
|
|
1510
|
-
|
|
1536
|
+
1. Retrieve the table list for each selected dataset. The query differs by dataset type:
|
|
1537
|
+
- Project datasets: \`SELECT table_name FROM \\\`{project}.{dataset}.INFORMATION_SCHEMA.TABLES\\\`\`
|
|
1538
|
+
- Public datasets (\`bigquery-public-data.*\`): \`SELECT table_name FROM \\\`bigquery-public-data.{dataset}.INFORMATION_SCHEMA.TABLES\\\`\`
|
|
1539
|
+
- Use UNION ALL for multiple datasets
|
|
1540
|
+
2. Branch based on results:
|
|
1511
1541
|
- **2 or more tables**: Present them to the user via \`askUserQuestion\` (multiSelect: true) and let them select which tables to use. Include the dataset name in the description
|
|
1512
1542
|
- **Exactly 1 table**: Do NOT call askUserQuestion. Auto-select it
|
|
1513
1543
|
|
|
1514
1544
|
#### Step 4: Complete Setup
|
|
1515
|
-
|
|
1516
|
-
- \`dataset\`: Selected dataset name(s) (comma-separated if multiple)
|
|
1545
|
+
1. Call \`updateConnectionContext\`:
|
|
1546
|
+
- \`dataset\`: Selected dataset name(s) (comma-separated if multiple). Record public datasets in the format \`bigquery-public-data.{dataset}\`
|
|
1517
1547
|
- \`tables\`: Selected table name(s) (comma-separated if multiple)
|
|
1518
1548
|
- \`note\`: Brief description of the setup
|
|
1519
1549
|
|