@itentialopensource/adapter-snowflake_sql 0.1.2 → 0.2.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.
Files changed (43) hide show
  1. package/.eslintignore +0 -1
  2. package/.jshintrc +3 -0
  3. package/CALLS.md +3 -3
  4. package/CHANGELOG.md +8 -0
  5. package/CONTRIBUTING.md +1 -160
  6. package/ENHANCE.md +2 -2
  7. package/README.md +31 -22
  8. package/adapter.js +159 -330
  9. package/adapterBase.js +538 -873
  10. package/changelogs/changelog.md +16 -0
  11. package/metadata.json +49 -0
  12. package/package.json +22 -25
  13. package/pronghorn.json +474 -142
  14. package/propertiesSchema.json +452 -40
  15. package/refs?service=git-upload-pack +0 -0
  16. package/report/adapter-openapi.json +1067 -0
  17. package/report/adapter-openapi.yaml +835 -0
  18. package/report/adapterInfo.json +8 -8
  19. package/report/updateReport1691508592263.json +120 -0
  20. package/report/updateReport1692203025860.json +120 -0
  21. package/report/updateReport1694466971841.json +120 -0
  22. package/report/updateReport1698422117858.json +120 -0
  23. package/sampleProperties.json +63 -2
  24. package/test/integration/adapterTestBasicGet.js +1 -1
  25. package/test/integration/adapterTestConnectivity.js +91 -42
  26. package/test/integration/adapterTestIntegration.js +130 -2
  27. package/test/unit/adapterBaseTestUnit.js +388 -314
  28. package/test/unit/adapterTestUnit.js +306 -109
  29. package/utils/adapterInfo.js +1 -1
  30. package/utils/addAuth.js +1 -1
  31. package/utils/artifactize.js +1 -1
  32. package/utils/checkMigrate.js +1 -1
  33. package/utils/entitiesToDB.js +1 -0
  34. package/utils/findPath.js +1 -1
  35. package/utils/methodDocumentor.js +71 -23
  36. package/utils/modify.js +13 -15
  37. package/utils/packModificationScript.js +1 -1
  38. package/utils/taskMover.js +309 -0
  39. package/utils/tbScript.js +3 -10
  40. package/utils/tbUtils.js +2 -3
  41. package/utils/testRunner.js +1 -1
  42. package/utils/troubleshootingAdapter.js +1 -3
  43. package/workflows/README.md +0 -3
@@ -0,0 +1,835 @@
1
+ openapi: 3.0.0
2
+ info:
3
+ title: Snowflake SQL API
4
+ description: 'The Snowflake SQL API is a REST API that you can use to access and update data in a Snowflake database. '
5
+ contact:
6
+ name: Snowflake, Inc.
7
+ url: https://snowflake.com
8
+ email: support@snowflake.com
9
+ version: '2.0.0'
10
+ servers:
11
+ - url: https://org-account.snowflakecomputing.com
12
+ description: Snowflake SQL API V2
13
+ variables: {}
14
+ paths:
15
+ /api/v2/statements:
16
+ post:
17
+ tags:
18
+ - statements
19
+ summary: SubmitStatement
20
+ description: Submits a single statement for execution. You can specify that the statement should be executed asynchronously.
21
+ operationId: SubmitStatement
22
+ parameters:
23
+ - name: requestId
24
+ in: query
25
+ description: Unique ID of the API request. This ensures that the execution is idempotent. If not specified, a new UUID is generated and assigned.
26
+ style: form
27
+ explode: true
28
+ schema:
29
+ type: string
30
+ format: uuid
31
+ - name: async
32
+ in: query
33
+ description: Set to true to execute the statement asynchronously and return the statement handle. If the parameter is not specified or is set to false, a statement is executed and the first result is returned if the execution is completed in 45 seconds. If the statement execution takes longer to complete, the statement handle is returned.
34
+ style: form
35
+ explode: true
36
+ schema:
37
+ type: boolean
38
+ example: true
39
+ - name: nullable
40
+ in: query
41
+ description: Set to true to execute the statement to generate the result set including null. If the parameter is set to false, the result set value null will be replaced with a string 'null'.
42
+ style: form
43
+ explode: true
44
+ schema:
45
+ type: boolean
46
+ example: true
47
+ - name: Accept
48
+ in: header
49
+ description: The response payload format. The schema should be specified in resultSetMetaData in the request payload.
50
+ style: simple
51
+ schema:
52
+ type: string
53
+ example: application/json
54
+ - name: User-Agent
55
+ in: header
56
+ description: Set this to the name and version of your application (e.g. “applicationName/applicationVersion”). You must use a value that complies with RFC 7231.
57
+ required: true
58
+ style: simple
59
+ schema:
60
+ type: string
61
+ example: myApplication/1.0
62
+ - name: X-Snowflake-Authorization-Token-Type
63
+ in: header
64
+ description: Specify the authorization token type for the Authorization header. KEYPAIR_JWT is for Keypair JWT or OAUTH for oAuth token. If not specified, OAUTH is assumed.
65
+ style: simple
66
+ schema:
67
+ type: string
68
+ example: KEYPAIR_JWT
69
+ requestBody:
70
+ description: Specifies the SQL statement to execute and the statement context.
71
+ content:
72
+ application/json:
73
+ schema:
74
+ allOf:
75
+ - $ref: '#/components/schemas/ApiV2StatementsRequest'
76
+ - description: Specifies the SQL statement to execute and the statement context.
77
+ example:
78
+ statement: select * from T where c1=?
79
+ timeout: 10
80
+ database: TESTDB
81
+ schema: TESTSCHEMA
82
+ warehouse: TESTWH
83
+ bindings:
84
+ '1':
85
+ type: FIXED
86
+ value: '123'
87
+ example:
88
+ statement: select * from T where c1=?
89
+ timeout: 10
90
+ database: TESTDB
91
+ schema: TESTSCHEMA
92
+ warehouse: TESTWH
93
+ bindings:
94
+ '1':
95
+ type: FIXED
96
+ value: '123'
97
+ required: true
98
+ responses:
99
+ '200':
100
+ description: The statement was executed successfully, and the response includes any data requested.
101
+ headers:
102
+ link:
103
+ content:
104
+ text/plain:
105
+ schema:
106
+ type: string
107
+ example: </api/statements/e127cc7c-7812-4e72-9a55-3b4d4f969840/fetch?partition=1>;rel="last",</api/statements/e127cc7c-7812-4e72-9a55-3b4d4f969840/fetch?partition=1>;rel="next",</api/statements/e127cc7c-7812-4e72-9a55-3b4d4f969840/fetch?partition=0>;rel="first"
108
+ example: </api/statements/e127cc7c-7812-4e72-9a55-3b4d4f969840/fetch?partition=1>;rel="last",</api/statements/e127cc7c-7812-4e72-9a55-3b4d4f969840/fetch?partition=1>;rel="next",</api/statements/e127cc7c-7812-4e72-9a55-3b4d4f969840/fetch?partition=0>;rel="first"
109
+ content:
110
+ application/json:
111
+ schema:
112
+ $ref: '#/components/schemas/ResultSet'
113
+ '202':
114
+ description: The execution of the statement is still in progress. Use GET /statements/ and specify the statement handle to check the status of the statement execution.
115
+ headers: {}
116
+ content:
117
+ application/json:
118
+ schema:
119
+ $ref: '#/components/schemas/QueryStatus'
120
+ '400':
121
+ description: Bad Request. The request payload is invalid or malformed. This happens if the application didn't send the correct request payload. The response body may include the error code and message indicating the actual cause. The application must reconstruct the request body for retry.
122
+ headers: {}
123
+ content: {}
124
+ '401':
125
+ description: Unauthorized. The request is not authorized. This happens if the attached access token is invalid or missing. The response body may include the error code and message indicating the actual cause, e.g., expired, invalid token. The application must obtain a new access token for retry.
126
+ headers: {}
127
+ content: {}
128
+ '403':
129
+ description: Forbidden. The request is forbidden. This happens if the request is made even if the API is not enabled.
130
+ headers: {}
131
+ content: {}
132
+ '404':
133
+ description: Not Found. The request endpoint is not valid. This happens if the API endpoint is wrong. For example, if the application hits /api/api/hello which doesn't exist, it will receive this code.
134
+ headers: {}
135
+ content: {}
136
+ '405':
137
+ description: Method Not Allowed. The request method doesn't match the supported API. This happens, for example, if the application calls the API with GET method but the endpoint accepts only POST. The application must change a method for retry.
138
+ headers: {}
139
+ content: {}
140
+ '408':
141
+ description: The execution of the statement exceeded the timeout period. The execution of the statement was cancelled.
142
+ headers: {}
143
+ content:
144
+ application/json:
145
+ schema:
146
+ $ref: '#/components/schemas/QueryStatus'
147
+ '415':
148
+ description: The request header Content-Type includes unsupported media type. The API supports application/json only. If none specified, the request payload is taken as JSON, but if any other media type is specified, this error is returned.
149
+ headers: {}
150
+ content: {}
151
+ '422':
152
+ description: An error occurred when executing the statement. Check the error code and error message for details.
153
+ headers: {}
154
+ content:
155
+ application/json:
156
+ schema:
157
+ $ref: '#/components/schemas/QueryFailureStatus'
158
+ '429':
159
+ description: Limit Exceeded. The number of requests hit the rate limit. The application must slow down the frequency of hitting the API endpoints.
160
+ headers: {}
161
+ content: {}
162
+ '500':
163
+ description: Internal Server Error. The server hits an unrecoverable system error. The response body may include the error code and message for further guidance. The application owner may need to reach out the customer support.
164
+ headers: {}
165
+ content: {}
166
+ '503':
167
+ description: Service Unavailable. The request was not processed due to server side timeouts. The application may retry with backoff. The jittered backoff is recommended. https://aws.amazon.com/blogs/architecture/exponential-backoff-and-jitter/
168
+ headers: {}
169
+ content: {}
170
+ '504':
171
+ description: Gateway Timeout. The request was not processed due to server side timeouts. The application may retry with backoff. The jittered backoff is recommended. https://aws.amazon.com/blogs/architecture/exponential-backoff-and-jitter/
172
+ headers: {}
173
+ content: {}
174
+ deprecated: false
175
+ security:
176
+ - keyPair: []
177
+ - ExternalOAuth: []
178
+ - snowflakeOAuth: []
179
+ /api/v2/statements/{statementHandle}:
180
+ get:
181
+ tags:
182
+ - statements
183
+ summary: GetStatementStatus
184
+ description: Checks the status of the execution of the statement with the specified statement handle. If the statement was executed successfully, the operation returns the requested partition of the result set.
185
+ operationId: GetStatementStatus
186
+ parameters:
187
+ - name: statementHandle
188
+ in: path
189
+ description: The handle of the statement that you want to use (e.g. to fetch the result set or cancel execution).
190
+ required: true
191
+ style: simple
192
+ schema:
193
+ type: string
194
+ format: uuid
195
+ example: e4ce975e-f7ff-4b5e-b15e-bf25f59371ae
196
+ - name: requestId
197
+ in: query
198
+ description: Unique ID of the API request. This ensures that the execution is idempotent. If not specified, a new UUID is generated and assigned.
199
+ style: form
200
+ explode: true
201
+ schema:
202
+ type: string
203
+ format: uuid
204
+ - name: partition
205
+ in: query
206
+ description: Number of the partition of results to return. The number can range from 0 to the total number of partitions minus 1.
207
+ style: form
208
+ explode: true
209
+ schema:
210
+ minimum: 0
211
+ type: integer
212
+ format: int64
213
+ example: 2
214
+ - name: Accept
215
+ in: header
216
+ description: The response payload format. The schema should be specified in resultSetMetaData in the request payload.
217
+ style: simple
218
+ schema:
219
+ type: string
220
+ example: application/json
221
+ - name: User-Agent
222
+ in: header
223
+ description: Set this to the name and version of your application (e.g. “applicationName/applicationVersion”). You must use a value that complies with RFC 7231.
224
+ required: true
225
+ style: simple
226
+ schema:
227
+ type: string
228
+ example: myApplication/1.0
229
+ - name: X-Snowflake-Authorization-Token-Type
230
+ in: header
231
+ description: Specify the authorization token type for the Authorization header. KEYPAIR_JWT is for Keypair JWT or OAUTH for oAuth token. If not specified, OAUTH is assumed.
232
+ style: simple
233
+ schema:
234
+ type: string
235
+ example: KEYPAIR_JWT
236
+ responses:
237
+ '200':
238
+ description: The statement was executed successfully, and the response includes any data requested.
239
+ headers:
240
+ link:
241
+ content:
242
+ text/plain:
243
+ schema:
244
+ type: string
245
+ example: </api/statements/e127cc7c-7812-4e72-9a55-3b4d4f969840/fetch?partition=1>;rel="last",</api/statements/e127cc7c-7812-4e72-9a55-3b4d4f969840/fetch?partition=1>;rel="next",</api/statements/e127cc7c-7812-4e72-9a55-3b4d4f969840/fetch?partition=0>;rel="first"
246
+ example: </api/statements/e127cc7c-7812-4e72-9a55-3b4d4f969840/fetch?partition=1>;rel="last",</api/statements/e127cc7c-7812-4e72-9a55-3b4d4f969840/fetch?partition=1>;rel="next",</api/statements/e127cc7c-7812-4e72-9a55-3b4d4f969840/fetch?partition=0>;rel="first"
247
+ content:
248
+ application/json:
249
+ schema:
250
+ $ref: '#/components/schemas/ResultSet'
251
+ '202':
252
+ description: The execution of the statement is still in progress. Use this method again to check the status of the statement execution.
253
+ headers: {}
254
+ content:
255
+ application/json:
256
+ schema:
257
+ $ref: '#/components/schemas/QueryStatus'
258
+ '400':
259
+ description: Bad Request. The request payload is invalid or malformed. This happens if the application didn't send the correct request payload. The response body may include the error code and message indicating the actual cause. The application must reconstruct the request body for retry.
260
+ headers: {}
261
+ content: {}
262
+ '401':
263
+ description: Unauthorized. The request is not authorized. This happens if the attached access token is invalid or missing. The response body may include the error code and message indicating the actual cause, e.g., expired, invalid token. The application must obtain a new access token for retry.
264
+ headers: {}
265
+ content: {}
266
+ '403':
267
+ description: Forbidden. The request is forbidden. This happens if the request is made even if the API is not enabled.
268
+ headers: {}
269
+ content: {}
270
+ '404':
271
+ description: Not Found. The request endpoint is not valid. This happens if the API endpoint is wrong. For example, if the application hits /api/api/hello which doesn't exist, it will receive this code.
272
+ headers: {}
273
+ content: {}
274
+ '405':
275
+ description: Method Not Allowed. The request method doesn't match the supported API. This happens, for example, if the application calls the API with GET method but the endpoint accepts only POST. The application must change a method for retry.
276
+ headers: {}
277
+ content: {}
278
+ '415':
279
+ description: The request header Content-Type includes unsupported media type. The API supports application/json only. If none specified, the request payload is taken as JSON, but if any other media type is specified, this error is returned.
280
+ headers: {}
281
+ content: {}
282
+ '422':
283
+ description: An error occurred when executing the statement. Check the error code and error message for details.
284
+ headers: {}
285
+ content:
286
+ application/json:
287
+ schema:
288
+ $ref: '#/components/schemas/QueryFailureStatus'
289
+ '429':
290
+ description: Limit Exceeded. The number of requests hit the rate limit. The application must slow down the frequency of hitting the API endpoints.
291
+ headers: {}
292
+ content: {}
293
+ '500':
294
+ description: Internal Server Error. The server hits an unrecoverable system error. The response body may include the error code and message for further guidance. The application owner may need to reach out the customer support.
295
+ headers: {}
296
+ content: {}
297
+ '503':
298
+ description: Service Unavailable. The request was not processed due to server side timeouts. The application may retry with backoff. The jittered backoff is recommended. https://aws.amazon.com/blogs/architecture/exponential-backoff-and-jitter/
299
+ headers: {}
300
+ content: {}
301
+ '504':
302
+ description: Gateway Timeout. The request was not processed due to server side timeouts. The application may retry with backoff. The jittered backoff is recommended. https://aws.amazon.com/blogs/architecture/exponential-backoff-and-jitter/
303
+ headers: {}
304
+ content: {}
305
+ deprecated: false
306
+ security:
307
+ - keyPair: []
308
+ - ExternalOAuth: []
309
+ - snowflakeOAuth: []
310
+ /api/v2/statements/{statementHandle}/cancel:
311
+ post:
312
+ tags:
313
+ - statements
314
+ summary: CancelStatement
315
+ description: Cancels the execution of the statement with the specified statement handle.
316
+ operationId: CancelStatement
317
+ parameters:
318
+ - name: statementHandle
319
+ in: path
320
+ description: The handle of the statement that you want to use (e.g. to fetch the result set or cancel execution).
321
+ required: true
322
+ style: simple
323
+ schema:
324
+ type: string
325
+ format: uuid
326
+ example: e4ce975e-f7ff-4b5e-b15e-bf25f59371ae
327
+ - name: requestId
328
+ in: query
329
+ description: Unique ID of the API request. This ensures that the execution is idempotent. If not specified, a new UUID is generated and assigned.
330
+ style: form
331
+ explode: true
332
+ schema:
333
+ type: string
334
+ format: uuid
335
+ - name: Accept
336
+ in: header
337
+ description: The response payload format. The schema should be specified in resultSetMetaData in the request payload.
338
+ style: simple
339
+ schema:
340
+ type: string
341
+ example: application/json
342
+ - name: User-Agent
343
+ in: header
344
+ description: Set this to the name and version of your application (e.g. “applicationName/applicationVersion”). You must use a value that complies with RFC 7231.
345
+ required: true
346
+ style: simple
347
+ schema:
348
+ type: string
349
+ example: myApplication/1.0
350
+ - name: X-Snowflake-Authorization-Token-Type
351
+ in: header
352
+ description: Specify the authorization token type for the Authorization header. KEYPAIR_JWT is for Keypair JWT or OAUTH for oAuth token. If not specified, OAUTH is assumed.
353
+ style: simple
354
+ schema:
355
+ type: string
356
+ example: KEYPAIR_JWT
357
+ responses:
358
+ '200':
359
+ description: The execution of the statement was successfully canceled.
360
+ headers: {}
361
+ content:
362
+ application/json:
363
+ schema:
364
+ $ref: '#/components/schemas/CancelStatus'
365
+ '400':
366
+ description: Bad Request. The request payload is invalid or malformed. This happens if the application didn't send the correct request payload. The response body may include the error code and message indicating the actual cause. The application must reconstruct the request body for retry.
367
+ headers: {}
368
+ content: {}
369
+ '401':
370
+ description: Unauthorized. The request is not authorized. This happens if the attached access token is invalid or missing. The response body may include the error code and message indicating the actual cause, e.g., expired, invalid token. The application must obtain a new access token for retry.
371
+ headers: {}
372
+ content: {}
373
+ '403':
374
+ description: Forbidden. The request is forbidden. This happens if the request is made even if the API is not enabled.
375
+ headers: {}
376
+ content: {}
377
+ '404':
378
+ description: Not Found. The request endpoint is not valid. This happens if the API endpoint is wrong. For example, if the application hits /api/api/hello which doesn't exist, it will receive this code.
379
+ headers: {}
380
+ content: {}
381
+ '405':
382
+ description: Method Not Allowed. The request method doesn't match the supported API. This happens, for example, if the application calls the API with GET method but the endpoint accepts only POST. The application must change a method for retry.
383
+ headers: {}
384
+ content: {}
385
+ '422':
386
+ description: An error occurred when cancelling the execution of the statement. Check the error code and error message for details.
387
+ headers: {}
388
+ content:
389
+ application/json:
390
+ schema:
391
+ $ref: '#/components/schemas/CancelStatus'
392
+ '500':
393
+ description: Internal Server Error. The server hits an unrecoverable system error. The response body may include the error code and message for further guidance. The application owner may need to reach out the customer support.
394
+ headers: {}
395
+ content: {}
396
+ '503':
397
+ description: Service Unavailable. The request was not processed due to server side timeouts. The application may retry with backoff. The jittered backoff is recommended. https://aws.amazon.com/blogs/architecture/exponential-backoff-and-jitter/
398
+ headers: {}
399
+ content: {}
400
+ '504':
401
+ description: Gateway Timeout. The request was not processed due to server side timeouts. The application may retry with backoff. The jittered backoff is recommended. https://aws.amazon.com/blogs/architecture/exponential-backoff-and-jitter/
402
+ headers: {}
403
+ content: {}
404
+ deprecated: false
405
+ security:
406
+ - keyPair: []
407
+ - ExternalOAuth: []
408
+ - snowflakeOAuth: []
409
+ components:
410
+ schemas:
411
+ QueryStatus:
412
+ title: QueryStatus
413
+ required:
414
+ - statementHandle
415
+ type: object
416
+ properties:
417
+ code:
418
+ type: string
419
+ sqlState:
420
+ type: string
421
+ message:
422
+ type: string
423
+ statementHandle:
424
+ type: string
425
+ format: uuid
426
+ createdOn:
427
+ type: integer
428
+ description: Timestamp that specifies when the statement execution started. The timestamp is expressed in milliseconds since the epoch.
429
+ format: int64
430
+ example: 1597090533987
431
+ statementStatusUrl:
432
+ type: string
433
+ description: URL that you can use to check the status of the execution of the statement and the result set.
434
+ example:
435
+ code: '000000'
436
+ sqlState: '00000'
437
+ message: successfully executed
438
+ statementHandle: e4ce975e-f7ff-4b5e-b15e-bf25f59371ae
439
+ createdOn: 1597090533987
440
+ statementStatusUrl: /api/v2/statements/e4ce975e-f7ff-4b5e-b15e-bf25f59371ae?requestId=f63f7776-71d8-4ae6-af69-8c0e54dcf906
441
+ QueryFailureStatus:
442
+ title: QueryFailureStatus
443
+ required:
444
+ - message
445
+ - statementHandle
446
+ type: object
447
+ properties:
448
+ code:
449
+ type: string
450
+ sqlState:
451
+ type: string
452
+ message:
453
+ type: string
454
+ statementHandle:
455
+ type: string
456
+ format: uuid
457
+ createdOn:
458
+ type: integer
459
+ description: Timestamp that specifies when the statement execution started.‌ The timestamp is expressed in milliseconds since the epoch.
460
+ format: int64
461
+ statementStatusUrl:
462
+ type: string
463
+ example:
464
+ code: '000123'
465
+ sqlState: '42601'
466
+ message: SQL compilation error
467
+ statementHandle: e4ce975e-f7ff-4b5e-b15e-bf25f59371ae
468
+ createdOn: 1597090533987
469
+ statementStatusUrl: /api/v2/statements/e4ce975e-f7ff-4b5e-b15e-bf25f59371ae
470
+ CancelStatus:
471
+ title: CancelStatus
472
+ required:
473
+ - statementHandle
474
+ type: object
475
+ properties:
476
+ code:
477
+ type: string
478
+ sqlState:
479
+ type: string
480
+ message:
481
+ type: string
482
+ statementHandle:
483
+ type: string
484
+ format: uuid
485
+ statementStatusUrl:
486
+ type: string
487
+ example:
488
+ message: successfully canceled
489
+ statementHandle: 536fad38-b564-4dc5-9892-a4543504df6c
490
+ statementStatusUrl: /api/v2/statements/536fad38-b564-4dc5-9892-a4543504df6c
491
+ ResultSet:
492
+ title: ResultSet
493
+ type: object
494
+ properties:
495
+ code:
496
+ type: string
497
+ example: '000123'
498
+ sqlState:
499
+ type: string
500
+ example: '42601'
501
+ message:
502
+ type: string
503
+ example: successfully executed
504
+ statementHandle:
505
+ type: string
506
+ format: uuid
507
+ example: 536fad38-b564-4dc5-9892-a4543504df6c
508
+ createdOn:
509
+ type: integer
510
+ description: Timestamp that specifies when the statement execution started.‌ The timestamp is expressed in milliseconds since the epoch.‌
511
+ format: int64
512
+ example: 1597090533987
513
+ statementStatusUrl:
514
+ type: string
515
+ example: /api/v2/statements/536fad38-b564-4dc5-9892-a4543504df6c
516
+ resultSetMetaData:
517
+ $ref: '#/components/schemas/ResultSetMetaData'
518
+ data:
519
+ minItems: 0
520
+ type: array
521
+ items:
522
+ type: array
523
+ items:
524
+ type: string
525
+ nullable: true
526
+ description: Result set data.
527
+ example:
528
+ - - customer1
529
+ - 1234 A Avenue
530
+ - '98765'
531
+ - 2019-08-10 23:56:34.123
532
+ - - customer2
533
+ - 987 B Street
534
+ - '98765'
535
+ - 2019-08-11 09:45:12.890
536
+ - - customer3
537
+ - 8777 C Blvd
538
+ - '98765'
539
+ - 2019-08-12 10:23:51.999
540
+ - - customer4
541
+ - 64646 D Circle
542
+ - '98765'
543
+ - 2019-08-13 01:54:32.000
544
+ stats:
545
+ allOf:
546
+ - $ref: '#/components/schemas/Stats'
547
+ - description: these stats might not be available for each request.
548
+ ApiV2StatementsRequest:
549
+ title: ApiV2StatementsRequest
550
+ type: object
551
+ properties:
552
+ statement:
553
+ type: string
554
+ description: 'SQL statement or batch of SQL statements to execute. You can specify query, DML and DDL statements. The following statements are not supported: PUT, GET, USE, ALTER SESSION, BEGIN, COMMIT, ROLLBACK, statements that set session variables, and statements that create temporary tables and stages.'
555
+ timeout:
556
+ minimum: 0
557
+ type: integer
558
+ description: Timeout in seconds for statement execution. If the execution of a statement takes longer than the specified timeout, the execution is automatically canceled. To set the timeout to the maximum value (604800 seconds), set timeout to 0.
559
+ format: int64
560
+ example: 10
561
+ database:
562
+ type: string
563
+ description: Database in which the statement should be executed. The value in this field is case-sensitive.
564
+ example: TESTDB
565
+ schema:
566
+ type: string
567
+ description: Schema in which the statement should be executed. The value in this field is case-sensitive.
568
+ example: TESTSCHEMA
569
+ warehouse:
570
+ type: string
571
+ description: Warehouse to use when executing the statement. The value in this field is case-sensitive.
572
+ example: TESTWH
573
+ role:
574
+ type: string
575
+ description: Role to use when executing the statement. The value in this field is case-sensitive.
576
+ example: TESTROLE
577
+ bindings:
578
+ type: object
579
+ description: Values of bind variables in the SQL statement. When executing the statement, Snowflake replaces placeholders ('?' and ':name') in the statement with these specified values.
580
+ example:
581
+ '1':
582
+ type: FIXED
583
+ value: '123'
584
+ '2':
585
+ type: TEXT
586
+ value: teststring
587
+ parameters:
588
+ allOf:
589
+ - $ref: '#/components/schemas/Parameters1'
590
+ - description: Session parameters that should be set before executing the statement.
591
+ Format:
592
+ title: Format
593
+ enum:
594
+ - jsonv2
595
+ type: string
596
+ description: For v2 endpoints the only possible value for this field is jsonv2.
597
+ example: jsonv2
598
+ Parameters:
599
+ title: Parameters
600
+ type: object
601
+ properties:
602
+ binary_output_format:
603
+ type: string
604
+ example: HEX
605
+ date_output_format:
606
+ type: string
607
+ example: YYYY-MM-DD
608
+ time_output_format:
609
+ type: string
610
+ example: HH24:MI:SS
611
+ timestamp_output_format:
612
+ type: string
613
+ example: YYYY-MM-DD HH24:MI:SS.FF6
614
+ timestamp_ltz_output_format:
615
+ type: string
616
+ example: YYYY-MM-DD HH24:MI:SS.FF6
617
+ timestamp_ntz_output_format:
618
+ type: string
619
+ example: YYYY-MM-DD HH24:MI:SS.FF6
620
+ timestamp_tz_output_format:
621
+ type: string
622
+ example: YYYY-MM-DDTHH24:MI:SS.FF6 TZHTZM
623
+ multi_statement_count:
624
+ type: integer
625
+ format: int32
626
+ example: 4
627
+ Parameters1:
628
+ title: Parameters1
629
+ type: object
630
+ properties:
631
+ timezone:
632
+ type: string
633
+ description: Time zone to use when executing the statement.
634
+ example: america/los_angeles
635
+ query_tag:
636
+ type: string
637
+ description: Query tag that you want to associate with the SQL statement.
638
+ example: tag-1234
639
+ binary_output_format:
640
+ type: string
641
+ description: Output format for binary values.
642
+ example: HEX
643
+ date_output_format:
644
+ type: string
645
+ description: Output format for DATE values.
646
+ example: YYYY-MM-DD
647
+ time_output_format:
648
+ type: string
649
+ description: Output format for TIME values.
650
+ example: HH24:MI:SS.FF6
651
+ timestamp_output_format:
652
+ type: string
653
+ description: Output format for TIMESTAMP values.
654
+ example: YYYY-MM-DDTHH24:MI:SS.FF6
655
+ timestamp_ltz_output_format:
656
+ type: string
657
+ description: Output format for TIMESTAMP_LTZ values.
658
+ example: YYYY-MM-DDTHH24:MI:SS.FF6
659
+ timestamp_ntz_output_format:
660
+ type: string
661
+ description: Output format for TIMESTAMP_NTZ values.
662
+ example: YYYY-MM-DDTHH24:MI:SS.FF6
663
+ timestamp_tz_output_format:
664
+ type: string
665
+ description: Output format for TIMESTAMP_TZ values.
666
+ example: YYYY-MM-DDTHH24:MI:SS.FF6 TZHTZM
667
+ multi_statement_count:
668
+ type: integer
669
+ description: Number of statements to execute when using multi-statement capability. 0 implies variable number of statements. Negative numbers are not allowed.
670
+ format: int32
671
+ default: 1
672
+ example: 4
673
+ description: Session parameters that should be set before executing the statement.
674
+ PartitionInfo:
675
+ title: PartitionInfo
676
+ type: object
677
+ properties:
678
+ rowCount:
679
+ minimum: 0
680
+ type: integer
681
+ description: Number of rows in the partition.
682
+ format: int64
683
+ example: 1324
684
+ compressedSize:
685
+ minimum: 0
686
+ type: integer
687
+ description: the partition size before the decompression. This may or may not be present in the partitionInfo. Uncompressed size would always be there.
688
+ format: int64
689
+ example: 37436824
690
+ uncompressedSize:
691
+ minimum: 0
692
+ type: integer
693
+ description: the partition size after the decompression
694
+ format: int64
695
+ example: 1343787384
696
+ ResultSetMetaData:
697
+ title: ResultSetMetaData
698
+ type: object
699
+ properties:
700
+ format:
701
+ allOf:
702
+ - $ref: '#/components/schemas/Format'
703
+ - description: For v2 endpoints the only possible value for this field is jsonv2.
704
+ example: jsonv2
705
+ rowType:
706
+ minItems: 1
707
+ type: array
708
+ items:
709
+ $ref: '#/components/schemas/RowType'
710
+ description: ''
711
+ example:
712
+ - name: ROWNUM
713
+ type: FIXED
714
+ length: 0
715
+ precision: 38
716
+ scale: 0
717
+ nullable: false
718
+ - name: ACCOUNT_ID
719
+ type: FIXED
720
+ length: 0
721
+ precision: 38
722
+ scale: 0
723
+ nullable: false
724
+ - name: ACCOUNT_NAME
725
+ type: TEXT
726
+ length: 1024
727
+ precision: 0
728
+ scale: 0
729
+ nullable: false
730
+ - name: ADDRESS
731
+ type: TEXT
732
+ length: 16777216
733
+ precision: 0
734
+ scale: 0
735
+ nullable: true
736
+ - name: ZIP
737
+ type: TEXT
738
+ length: 100
739
+ precision: 0
740
+ scale: 0
741
+ nullable: true
742
+ - name: CREATED_ON
743
+ type: TIMESTAMP_NTZ
744
+ length: 0
745
+ precision: 0
746
+ scale: 3
747
+ nullable: false
748
+ partitionInfo:
749
+ minItems: 0
750
+ type: array
751
+ items:
752
+ $ref: '#/components/schemas/PartitionInfo'
753
+ description: Partition information
754
+ nullable:
755
+ type: boolean
756
+ description: false if null is replaced with a string 'null' otherwise false
757
+ parameters:
758
+ $ref: '#/components/schemas/Parameters'
759
+ RowType:
760
+ title: RowType
761
+ type: object
762
+ properties:
763
+ name:
764
+ type: string
765
+ type:
766
+ type: string
767
+ length:
768
+ minimum: 0
769
+ type: integer
770
+ format: int64
771
+ precision:
772
+ minimum: 0
773
+ type: integer
774
+ format: int64
775
+ scale:
776
+ minimum: 0
777
+ type: integer
778
+ format: int64
779
+ nullable:
780
+ type: boolean
781
+ Stats:
782
+ title: Stats
783
+ type: object
784
+ properties:
785
+ numRowsInserted:
786
+ minimum: 0
787
+ type: integer
788
+ description: Number of rows that were inserted.
789
+ format: int64
790
+ example: 12
791
+ numRowsUpdated:
792
+ minimum: 0
793
+ type: integer
794
+ description: Number of rows that were updated.
795
+ format: int64
796
+ example: 9
797
+ numRowsDeleted:
798
+ minimum: 0
799
+ type: integer
800
+ description: Number of rows that were deleted.
801
+ format: int64
802
+ example: 8
803
+ numDuplicateRowsUpdated:
804
+ minimum: 0
805
+ type: integer
806
+ description: Number of duplicate rows that were updated.
807
+ format: int64
808
+ example: 20
809
+ description: these stats might not be available for each request.
810
+ securitySchemes:
811
+ keyPair:
812
+ type: http
813
+ description: Set X-Snowflake-Authorization-Token-Type to KEYPAIR_JWT if the token is a key pair authn JWT.
814
+ scheme: bearer
815
+ bearerFormat: jwt
816
+ ExternalOAuth:
817
+ type: http
818
+ description: Configure External Oauth with Snowflake (refer to docs). Set X-Snowflake-Authorization-Token-Type to OAUTH and set the Token to auth token received from the external Auth server.
819
+ scheme: bearer
820
+ bearerFormat: jwt
821
+ snowflakeOAuth:
822
+ type: oauth2
823
+ flows:
824
+ implicit:
825
+ authorizationUrl: https://org-account.snowflakecomputing.com/oauth/authorize
826
+ scopes: {}
827
+ security:
828
+ - keyPair: []
829
+ - ExternalOAuth: []
830
+ - snowflakeOAuth: []
831
+ tags:
832
+ - name: statements
833
+ description: ''
834
+ externalDocs:
835
+ url: https://docs.snowflake.com/en/developer-guide/sql-api/index.html