Skip to content

Commit 49cb9e5

Browse files
authored
docs: Improve query setting readme and examples (#146)
1 parent ccda017 commit 49cb9e5

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

README.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -313,11 +313,18 @@ const statement = await connection.execute(query, executeQueryOptions);
313313

314314
### Execute Query with set flags
315315

316+
This approach is useful if you want to modify the execution of a particular query, for example setting a timeout or modifying a time zone for date calculations.
317+
316318
```typescript
317319
const statement = await connection.execute(query, {
318-
settings: { query_id: 'hello' }
320+
settings: { statement_timeout: 1000 }
319321
});
320322
```
323+
Full list of flags that can be passed here is available on this documentation [page](https://docs.firebolt.io/reference/system-settings).
324+
325+
**Note:** the flags set in this way will be active only for the duration of the query. If you require a session-level flag, which would apply to all the queries executed on this connection, use the SQL syntax to set it:
326+
327+
```await connection.execute("SET statement_timeout=1000")```
321328

322329
<a id="executequeryoptions"></a>
323330
### ExecuteQueryOptions
@@ -377,8 +384,8 @@ The previous query will produce: `select 'foo', 123` query
377384
| output_format | | JSON_COMPACT | Specifies format of selected data |
378385

379386
You can also use `QuerySettings` to specify set flags.
380-
For example: `{ query_id: 'hello' }`
381-
387+
For example: `{ statement_timeout: 1000 }`
388+
Full list of available settings can be found on this [page](https://docs.firebolt.io/reference/system-settings).
382389

383390
<a id="executequeryresponse"></a>
384391
### ResponseSettings

0 commit comments

Comments
 (0)