Interface IQldbDriver
Interface for the QLDB driver.
Inherited Members
Namespace: Amazon.QLDB.Driver
Assembly: Amazon.QLDB.Driver.dll
Syntax
public interface IQldbDriver : IDisposable
Methods
| Improve this Doc View SourceExecute(Action<TransactionExecutor>)
Execute the Executor lambda against QLDB within a transaction where no result is expected.
Declaration
void Execute(Action<TransactionExecutor> action)
Parameters
Type | Name | Description |
---|---|---|
System.Action<TransactionExecutor> | action | The Executor lambda with no return value representing the block of code to be executed within the transaction. This cannot have any side effects as it may be invoked multiple times. |
Exceptions
Type | Condition |
---|---|
TransactionAbortedException | Thrown if the Executor lambda calls Abort(). |
QldbDriverException | Thrown when called on a disposed instance. |
Amazon.Runtime.AmazonServiceException | Thrown when there is an error executing against QLDB. |
Execute(Action<TransactionExecutor>, RetryPolicy)
Execute the Executor lambda against QLDB within a transaction where no result is expected.
Declaration
void Execute(Action<TransactionExecutor> action, RetryPolicy retryPolicy)
Parameters
Type | Name | Description |
---|---|---|
System.Action<TransactionExecutor> | action | The Executor lambda with no return value representing the block of code to be executed within the transaction. This cannot have any side effects as it may be invoked multiple times. |
RetryPolicy | retryPolicy | A RetryPolicy that overrides the RetryPolicy set when creating the driver. The given retry policy will be used when retrying the transaction. |
Exceptions
Type | Condition |
---|---|
TransactionAbortedException | Thrown if the Executor lambda calls Abort(). |
QldbDriverException | Thrown when called on a disposed instance. |
Amazon.Runtime.AmazonServiceException | Thrown when there is an error executing against QLDB. |
Execute(Action<TransactionExecutor>, Action<Int32>)
Execute the Executor lambda against QLDB within a transaction where no result is expected.
Declaration
[Obsolete("As of release 1.0, replaced by 'retryPolicy'. Will be removed in the next major release.")]
void Execute(Action<TransactionExecutor> action, Action<int> retryAction)
Parameters
Type | Name | Description |
---|---|---|
System.Action<TransactionExecutor> | action | The Executor lambda with no return value representing the block of code to be executed within the transaction. This cannot have any side effects as it may be invoked multiple times. |
System.Action<System.Int32> | retryAction | A lambda that is invoked when the Executor lambda is about to be retried due to a retriable error. Can be null if not applicable. |
Exceptions
Type | Condition |
---|---|
TransactionAbortedException | Thrown if the Executor lambda calls Abort(). |
QldbDriverException | Thrown when called on a disposed instance. |
Amazon.Runtime.AmazonServiceException | Thrown when there is an error executing against QLDB. |
Execute<T>(Func<TransactionExecutor, T>)
Execute the Executor lambda against QLDB and retrieve the result within a transaction.
Declaration
T Execute<T>(Func<TransactionExecutor, T> func)
Parameters
Type | Name | Description |
---|---|---|
System.Func<TransactionExecutor, T> | func | The Executor lambda representing the block of code to be executed within the transaction. This cannot have any side effects as it may be invoked multiple times, and the result cannot be trusted until the transaction is committed. |
Returns
Type | Description |
---|---|
T | The return value of executing the executor. Note that if you directly return a IResult, this will be automatically buffered in memory before the implicit commit to allow reading, as the commit will close any open results. Any other IResult instances created within the executor block will be invalidated, including if the return value is an object which nests said IResult instances within it. |
Type Parameters
Name | Description |
---|---|
T | The return type. |
Exceptions
Type | Condition |
---|---|
TransactionAbortedException | Thrown if the Executor lambda calls Abort(). |
QldbDriverException | Thrown when called on a disposed instance. |
Amazon.Runtime.AmazonServiceException | Thrown when there is an error executing against QLDB. |
Execute<T>(Func<TransactionExecutor, T>, RetryPolicy)
Execute the Executor lambda against QLDB and retrieve the result within a transaction.
Declaration
T Execute<T>(Func<TransactionExecutor, T> func, RetryPolicy retryPolicy)
Parameters
Type | Name | Description |
---|---|---|
System.Func<TransactionExecutor, T> | func | The Executor lambda representing the block of code to be executed within the transaction. This cannot have any side effects as it may be invoked multiple times, and the result cannot be trusted until the transaction is committed. |
RetryPolicy | retryPolicy | A RetryPolicy that overrides the RetryPolicy set when creating the driver. The given retry policy will be used when retrying the transaction. |
Returns
Type | Description |
---|---|
T | The return value of executing the executor. Note that if you directly return a IResult, this will be automatically buffered in memory before the implicit commit to allow reading, as the commit will close any open results. Any other IResult instances created within the executor block will be invalidated, including if the return value is an object which nests said IResult instances within it. |
Type Parameters
Name | Description |
---|---|
T | The return type. |
Exceptions
Type | Condition |
---|---|
TransactionAbortedException | Thrown if the Executor lambda calls Abort(). |
QldbDriverException | Thrown when called on a disposed instance. |
Amazon.Runtime.AmazonServiceException | Thrown when there is an error executing against QLDB. |
Execute<T>(Func<TransactionExecutor, T>, Action<Int32>)
Execute the Executor lambda against QLDB and retrieve the result within a transaction.
Declaration
[Obsolete("As of release 1.0, replaced by 'retryPolicy'. Will be removed in the next major release.")]
T Execute<T>(Func<TransactionExecutor, T> func, Action<int> retryAction)
Parameters
Type | Name | Description |
---|---|---|
System.Func<TransactionExecutor, T> | func | The Executor lambda representing the block of code to be executed within the transaction. This cannot have any side effects as it may be invoked multiple times, and the result cannot be trusted until the transaction is committed. |
System.Action<System.Int32> | retryAction | A lambda that is invoked when the Executor lambda is about to be retried due to a retriable error. Can be null if not applicable. |
Returns
Type | Description |
---|---|
T | The return value of executing the executor. Note that if you directly return a IResult, this will be automatically buffered in memory before the implicit commit to allow reading, as the commit will close any open results. Any other IResult instances created within the executor block will be invalidated, including if the return value is an object which nests said IResult instances within it. |
Type Parameters
Name | Description |
---|---|
T | The return type. |
Exceptions
Type | Condition |
---|---|
TransactionAbortedException | Thrown if the Executor lambda calls Abort(). |
QldbDriverException | Thrown when called on a disposed instance. |
Amazon.Runtime.AmazonServiceException | Thrown when there is an error executing against QLDB. |
ListTableNames()
Retrieve the table names that are available within the ledger.
Declaration
IEnumerable<string> ListTableNames()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<System.String> | The Enumerable over the table names in the ledger. |