You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -340,6 +344,44 @@ firebolt-sdk maps SQL data types to their corresponding JavaScript equivalents.
340
344
|| STRING | String ||
341
345
| Date & Time | DATE | Date ||
342
346
347
+
<aid="Server-side async queries"></a>
348
+
## Server-side async query execution
349
+
350
+
Firebolt supports server-side asynchronous query execution. This feature allows you to run
351
+
queries in the background and fetch the results later. This is especially useful for long-running
352
+
queries that you don't want to wait for or maintain a persistent connection to the server.
353
+
354
+
<aid="Execute Async Query"></a>
355
+
### Execute Async Query
356
+
357
+
Executes a query asynchronously. This is useful for long-running queries that you don't want to block the main thread. The resulting statement does not contain data and should only be used to receive an async query token. Token can be saved elsewhere and reused, even on a new connection to check on this query.
const token =statement.asyncQueryToken; // used to check query status and cancel it
362
+
// statement.fetchResult() -- not allowed as there's no result to fetch
363
+
```
364
+
365
+
<aid="Check Async Query Status"></a>
366
+
### Check Async Query Status
367
+
368
+
Checks the status of an asynchronous query. Use this to determine if the query is still running or has completed. `isAsyncQueryRunning` woudl return true or false if the query is running or has finished. `isAsyncQuerySuccessful` would return true if the query has completed successfully, false if it has failed and `undefined` if the query is still running.
369
+
370
+
```typescript
371
+
const token =statement.asyncQueryToken; // can only be fetched for async query
0 commit comments