From 9d06004478f8b000925e0e5bcf3f055bd7728821 Mon Sep 17 00:00:00 2001 From: Levko Kravets Date: Thu, 17 Aug 2023 09:37:40 +0300 Subject: [PATCH] Update changelog Signed-off-by: Levko Kravets --- CHANGELOG.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 332aa2fa..e7aa2961 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,34 @@ ## 1.4.0 - Added Cloud Fetch support (databricks/databricks-sql-nodejs#158) +- Improved handling of closed sessions and operations (databricks/databricks-sql-nodejs#129). + Now, when session gets closed, all operations associated with it are immediately closed. + Similarly, if client gets closed - all associated sessions (and their operations) are closed as well. + +**Notes**: + +Cloud Fetch is disabled by default. To use it, pass `useCloudFetch: true` +to `IDBSQLSession.executeStatement()`. For example: + +```ts +// obtain session object as usual +const operation = session.executeStatement(query, { + runAsync: true, + useCloudFetch: true, +}); +``` + +Note that Cloud Fetch is effectively enabled only for really large datasets, so if +the query returns only few thousands records, Cloud Fetch won't be enabled no matter +what `useCloudFetch` setting is. Also gentle reminder that for large datasets +it's better to use `fetchChunk` instead of `fetchAll` to avoid OOM errors: + +```ts +do { + const chunk = await operation.fetchChunk({ maxRows: 100000 }); + // process chunk here +} while (await operation.hasMoreRows()); +``` ## 1.3.0