No new features are introduced but 570 updates the peer dependency requirement ion-js
from ^4.3.0
to ^5.2.0
.
This is a minor release to incorporate a recent PR by the community: 245
- When the driver session is not live and a new one needs to be created and returned to the callee, the session is null resulting on an error: Cannot read properties of null (reading 'executeLambda'). The problem is that session var is not getting the new session recently created and it fails by returning null. It should re-up a connection and replace the driver object with the new session to the database.
All the changes are introduced by SDK V3, please check Migrating to the AWS SDK for JavaScript V3 to learn how to migrate to the AWS SDK for JavaScript V3 from AWS SDK for JavaScript V2.
- Migrated to AWS SDK for JavasScript V3.
- Fixed a order of operations bug in
defaultBackoffFunction
which would add up-to 10s of sleep over 4 retries, versus less than 300 ms total sleep between 4 retries. The defaultBackoffFunction strategy is defaulted if users do not provide their own backoff strategy function for theRetryConfig
.
- Changed driver constructor to take a new type of qldbClientOptions and added a new parameter httpOptions to configure the low level node http client separately. Application code needs to be modified for driver construction. For example, the following:
import { Agent } from 'https';
import { QldbDriver, RetryConfig } from 'amazon-qldb-driver-nodejs';
const maxConcurrentTransactions: number = 10;
const agentForQldb: Agent = new Agent({
keepAlive: true,
maxSockets: maxConcurrentTransactions
});
const serviceConfigurationOptions = {
region: "us-east-1",
httpOptions: {
agent: agentForQldb
}
};
const qldbDriver: QldbDriver = new QldbDriver("testLedger", serviceConfigurationOptions, maxConcurrentTransactions);
Should be changed to
import { Agent } from 'https';
import { QldbDriver, RetryConfig } from 'amazon-qldb-driver-nodejs';
import { NodeHttpHandlerOptions } from "@aws-sdk/node-http-handler";
const maxConcurrentTransactions: number = 10;
const lowLevelClientHttpOptions: NodeHttpHandlerOptions = {
httpAgent: new Agent({
keepAlive: true,
maxSockets: maxConcurrentTransactions
})
};
const serviceConfigurationOptions = {
region: "us-east-1"
};
const qldbDriver: QldbDriver = new QldbDriver("testLedger", serviceConfigurationOptions, lowLevelClientHttpOptions, maxConcurrentTransactions);
- Updated driver to comply with new service exception class.
This release is focused on improving the retry logic, optimizing it and handling more possible failures, as well as more strictly defining the API to help prevent misuse. These changes are potentially breaking if the driver is being used in a way that isn't supported by the documentation.
- Improved retry logic
- Failures when starting a new session are now retried.
- Dead sessions are immediately discarded, reducing latency when using the driver.
ClientError
,DriverClosedError
,LambdaAbortedError
, andSessionPoolEmptyError
are now exported.- Peer dependency
aws-sdk
bumped to2.841.0
or greater, which gives visibility toCapacityExceededException
.
- Updated the exponential backoff algorithm to better align with the algorithm specified here.
- Specify minimum Node.js version to 10.0 in package.json.
These changes either remove unintentionally exported modules or remove the use of any
. Updating to 2.2.0 should not break any documented usage of the driver and should not require code changes. If something is now incompatible and it's believed that it should be, please open an issue.
-
TypeScript: updated
executeLambda
signature-
// Old async ExecuteLambda(transactionLambda: (transactionExecutor: TransactionExecutor) => any, retryConfig?: RetryConfig): Promise<any>; // New async ExecuteLambda<Type>(transactionLambda: (transactionExecutor: TransactionExecutor) => Promise<Type>, retryConfig?: RetryConfig): Promise<Type>;
-
The returned value from the
transactionLambda
is whatExecuteLambda
returns, so it's now strictly defined by theType
. -
The
transactionLambda
must return aPromise
, as any methods called on theTransactionExecutor
must be awaited for the driver to properly function.
-
-
JavaScript: removed
QldbDriver.getSession()
- This is unavailable to TypeScript users and was not intended to be called directly by JavaScript users.
-
Module exports
- Removed
Transaction
from the exports list. - Removed modules being accessible when importing from
amazon-qldb-driver-nodejs/src
. - TypeScript: Removed constructors in the API for some exported types.
- Removed
- Fixed a bug where
No open transaction
orTransaction already open
errors would occur
- Export
ResultReadable
. - Change the return type of
executeAndStreamResults()
fromReadable
toResultReadable
which extendsReadable
. getConsumedIOs(): IOUsage
andgetTimingInformation(): TimingInformation
functions, are accessible throughResultReadable
.
Add support for obtaining basic server-side statistics on individual statement executions.
- Added
IOUsage
andTimingInformation
interface to provide server-side execution statistics- IOUsage provides
getReadIOs(): number
- TimingInformation provides
getProcessingTimeMilliseconds(): number
- Added
getConsumedIOs(): IOUsage
andgetTimingInformation(): TimingInformation
to theResult
andResultStream
getConsumedIOs(): IOUsage
andgetTimingInformation(): TimingInformation
methods are stateful, meaning the statistics returned by them reflect the state at the time of method execution
- IOUsage provides
Note: For using version 2.1.0 and above of the driver, the version of the aws-sdk should be >= 2.815
The release candidate 1 (v2.0.0-rc.1) has been selected as a final release of v2.0.0. No new changes are introduced between v2.0.0-rc.1 and v2.0.0. Please check the release notes
Note: This version is a release candidate. We might introduce some additional changes before releasing v2.0.0.
- Added support for defining customer retry config and backoffs.
-
Renamed
QldbDriver
propertypoolLimit
tomaxConcurrentTransactions
. -
Removed
QldbDriver
propertypoolTimeout
. -
Removed
retryIndicator
fromQldbSession.executeLambda
method and replaced it withretryConfig
. -
Moved
retryLimit
fromQldbDriver
constructor toRetryConfig
constructor. -
The classes and methods marked deprecated in version v1.0.0 have now been removed. List of classes and methods:
PooledQldbDriver
has been removed. Please useQldbDriver
instead.QldbSession.getTableNames
method has been removed. Please useQldbDriver.getTableNames
method instead.QldbSession.executeLambda
method has been removed. Please useQldbDriver.executeLambda
method instead.
The release candidate 2 (v1.0.0-rc.2) has been selected as a final release of v1.0.0. No new changes are introduced between v1.0.0-rc.2 and v1.0.0. Please check the release notes
- Session pooling functionality moved to QldbDriver. More details can be found in the release notes
- Fixed the delay calculation logic when retrying the transaction due to failure.
-
PooledQldbDriver
has been deprecated and will be removed in future versions. Please useQldbDriver
instead. Refer to the release notes -
QldbSession.getTableNames
method has been deprecated and will be removed in future versions. Please useQldbDriver.getTableNames
method instead. -
QldbSession.executeLambda
method has been deprecated and will be removed in future versions. Please useQldbDriver.executeLambda
method instead.
- (#22)
executeInline
method renamed toexecute
andexecuteStream
method renamed toexecuteAndStreamResults
. - (#23)
execute
andexecuteAndStreamResults
methods accept JavaScript built-in data types(and Ion Value data types) instead ofIonWriter
type. - (#24)
execute
andexecuteAndStreamResults
method accepts variable number of arguments instead of passing an array of arguments. - (#25) Query results will be returned as an Ion Value instead of an
IonReader
when running the PartiQL query viaexecute
and/orexecuteAndStreamResults
- Removed
executeStatement
method from Qldb Session. - Target version changed to ES6
-
(#5) The Ion Value results returned by
execute
andexecuteAndStreamResults
can be converted into JSON String viaJSON.stringify(result)
-
(#26) Introduced
executeLambda
method on Qldb Driver.
- "Error: stream.push() after EOF" bug #7
- On reading from ResultStream, potential event listeners might not have received an error. Error fixed by rightly calling the destroy method and passing the error to it.
- On starting a transaction, on consuming the resultstream, the last value could sometimes show up twice.
- "Digests don't match" bug #8
- Renamed src/logUtil.ts to src/LogUtil.ts to match PascalCase.
- Fix a bug in the test command that caused unit tests to fail compilation.
- Add a valid
buildspec.yml
file for running unit tests via CodeBuild.
- Small clarifications to the README.
- Preview release of the driver.