Class AdbDataReaderSource<TOutput>
A dataflow worker which executes an SQL query on a database, and sends the result set rows to a downstream worker.
Each source column data type must either be the same as the target column data type, or be
implicitly castable
to the target column data type, or be an enum or nullable enum whose
underlying type is implicitly castable to the target column integral data type.
The latter case allows a source column enum to be stored in a target integer column.
Also see SQL Database Access.
Implements
Inherited Members
Namespace: actionETL.Adb
Assembly: actionETL.dll
Syntax
public class AdbDataReaderSource<TOutput> : WorkerBase<AdbDataReaderSource<TOutput>>, IDisposeOnFinished where TOutput : class
Type Parameters
| Name | Description |
|---|---|
| TOutput | The type of each |
Constructors
AdbDataReaderSource(WorkerParent, String, AdbCommandBuilder, Action<IColumnMapperCommand>)
Initializes a new instance of the AdbDataReaderSource<TOutput> dataflow worker, which executes an SQL query on a database, using Default, and sends the result set rows to a downstream worker.
Declaration
public AdbDataReaderSource(WorkerParent workerParent, string workerName, AdbCommandBuilder commandBuilder, Action<IColumnMapperCommand> columnMapperCommandAction)
Parameters
| Type | Name | Description |
|---|---|---|
| WorkerParent | workerParent | The parent worker or worker system that the new child worker will be added to. Cannot be |
| String | workerName | Name of the worker.
Set to a prefix plus a trailing
While less useful, set to
The name cannot otherwise contain |
| AdbCommandBuilder | commandBuilder | A builder for the database command. Can be |
| Action<IColumnMapperCommand> | columnMapperCommandAction | An action that executes commands that define the column mappings, e.g. mapping two columns using from-name and to-index:
Column name matching is ordinal case insensitive, but a case sensitive match takes precedence over a case insensitive match. Also see the Dataflow Column Mapping and Mapping and Copying examples. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException |
|
| ArgumentException |
|
| ArgumentNullException |
|
| InvalidOperationException |
|
AdbDataReaderSource(WorkerParent, String, AdbCommandBuilder, CommandBehavior, Action<IColumnMapperCommand>)
Initializes a new instance of the AdbDataReaderSource<TOutput> dataflow worker, which executes an SQL query on a database, and sends the result set rows to a downstream worker.
Declaration
public AdbDataReaderSource(WorkerParent workerParent, string workerName, AdbCommandBuilder commandBuilder, CommandBehavior commandBehavior, Action<IColumnMapperCommand> columnMapperCommandAction)
Parameters
| Type | Name | Description |
|---|---|---|
| WorkerParent | workerParent | The parent worker or worker system that the new child worker will be added to. Cannot be |
| String | workerName | Name of the worker.
Set to a prefix plus a trailing
While less useful, set to
The name cannot otherwise contain |
| AdbCommandBuilder | commandBuilder | A builder for the database command. Can be |
| CommandBehavior | commandBehavior | The database command behavior. |
| Action<IColumnMapperCommand> | columnMapperCommandAction | An action that executes commands that define the column mappings, e.g. mapping two columns using from-name and to-index:
Column name matching is ordinal case insensitive, but a case sensitive match takes precedence over a case insensitive match. Also see the Dataflow Column Mapping and Mapping and Copying examples. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException |
|
| ArgumentException |
|
| ArgumentNullException |
|
| InvalidOperationException |
|
AdbDataReaderSource(WorkerParent, String, IAdbConnectionBuilder, String, Action<IColumnMapperCommand>)
Initializes a new instance of the AdbDataReaderSource<TOutput> dataflow worker, which executes an SQL query on a database, using Default, and sends the result set rows to a downstream worker.
Declaration
public AdbDataReaderSource(WorkerParent workerParent, string workerName, IAdbConnectionBuilder connectionBuilder, string queryText, Action<IColumnMapperCommand> columnMapperCommandAction)
Parameters
| Type | Name | Description |
|---|---|---|
| WorkerParent | workerParent | The parent worker or worker system that the new child worker will be added to. Cannot be |
| String | workerName | Name of the worker.
Set to a prefix plus a trailing
While less useful, set to
The name cannot otherwise contain |
| IAdbConnectionBuilder | connectionBuilder | The connection builder, must not be |
| String | queryText | The query text, must not be |
| Action<IColumnMapperCommand> | columnMapperCommandAction | An action that executes commands that define the column mappings, e.g. mapping two columns using from-name and to-index:
Column name matching is ordinal case insensitive, but a case sensitive match takes precedence over a case insensitive match. Also see the Dataflow Column Mapping and Mapping and Copying examples. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException |
|
| ArgumentException |
|
| ArgumentNullException |
|
| InvalidOperationException |
|
AdbDataReaderSource(WorkerParent, String, IAdbConnectionBuilder, String, CommandBehavior, Action<IColumnMapperCommand>)
Initializes a new instance of the AdbDataReaderSource<TOutput> dataflow worker, which executes an SQL query on a database, and sends the result set rows to a downstream worker.
Declaration
public AdbDataReaderSource(WorkerParent workerParent, string workerName, IAdbConnectionBuilder connectionBuilder, string queryText, CommandBehavior commandBehavior, Action<IColumnMapperCommand> columnMapperCommandAction)
Parameters
| Type | Name | Description |
|---|---|---|
| WorkerParent | workerParent | The parent worker or worker system that the new child worker will be added to. Cannot be |
| String | workerName | Name of the worker.
Set to a prefix plus a trailing
While less useful, set to
The name cannot otherwise contain |
| IAdbConnectionBuilder | connectionBuilder | The connection builder, must not be |
| String | queryText | The query text, must not be |
| CommandBehavior | commandBehavior | The database command behavior. |
| Action<IColumnMapperCommand> | columnMapperCommandAction | An action that executes commands that define the column mappings, e.g. mapping two columns using from-name and to-index:
Column name matching is ordinal case insensitive, but a case sensitive match takes precedence over a case insensitive match. Also see the Dataflow Column Mapping and Mapping and Copying examples. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException |
|
| ArgumentException |
|
| ArgumentNullException |
|
| InvalidOperationException |
|
AdbDataReaderSource(WorkerParent, String, Func<Boolean>, AdbCommandBuilder, Action<IColumnMapperCommand>)
Initializes a new instance of the AdbDataReaderSource<TOutput> dataflow worker, which executes an SQL query on a database, using Default, and sends the result set rows to a downstream worker.
Declaration
public AdbDataReaderSource(WorkerParent workerParent, string workerName, Func<bool> isStartableFunc, AdbCommandBuilder commandBuilder, Action<IColumnMapperCommand> columnMapperCommandAction)
Parameters
| Type | Name | Description |
|---|---|---|
| WorkerParent | workerParent | The parent worker or worker system that the new child worker will be added to. Cannot be |
| String | workerName | Name of the worker.
Set to a prefix plus a trailing
While less useful, set to
The name cannot otherwise contain |
| Func<Boolean> | isStartableFunc | Function to calculate the worker start constraint; it should return |
| AdbCommandBuilder | commandBuilder | A builder for the database command. Can be |
| Action<IColumnMapperCommand> | columnMapperCommandAction | An action that executes commands that define the column mappings, e.g. mapping two columns using from-name and to-index:
Column name matching is ordinal case insensitive, but a case sensitive match takes precedence over a case insensitive match. Also see the Dataflow Column Mapping and Mapping and Copying examples. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException |
|
| ArgumentException |
|
| ArgumentNullException |
|
| InvalidOperationException |
|
AdbDataReaderSource(WorkerParent, String, Func<Boolean>, AdbCommandBuilder, CommandBehavior, Action<IColumnMapperCommand>)
Initializes a new instance of the AdbDataReaderSource<TOutput> dataflow worker, which executes an SQL query on a database, and sends the result set rows to a downstream worker.
Declaration
public AdbDataReaderSource(WorkerParent workerParent, string workerName, Func<bool> isStartableFunc, AdbCommandBuilder commandBuilder, CommandBehavior commandBehavior, Action<IColumnMapperCommand> columnMapperCommandAction)
Parameters
| Type | Name | Description |
|---|---|---|
| WorkerParent | workerParent | The parent worker or worker system that the new child worker will be added to. Cannot be |
| String | workerName | Name of the worker.
Set to a prefix plus a trailing
While less useful, set to
The name cannot otherwise contain |
| Func<Boolean> | isStartableFunc | Function to calculate the worker start constraint; it should return |
| AdbCommandBuilder | commandBuilder | A builder for the database command. Can be |
| CommandBehavior | commandBehavior | The database command behavior. |
| Action<IColumnMapperCommand> | columnMapperCommandAction | An action that executes commands that define the column mappings, e.g. mapping two columns using from-name and to-index:
Column name matching is ordinal case insensitive, but a case sensitive match takes precedence over a case insensitive match. Also see the Dataflow Column Mapping and Mapping and Copying examples. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException |
|
| ArgumentException |
|
| ArgumentNullException |
|
| InvalidOperationException |
|
AdbDataReaderSource(WorkerParent, String, Func<Boolean>, IAdbConnectionBuilder, String, Action<IColumnMapperCommand>)
Initializes a new instance of the AdbDataReaderSource<TOutput> dataflow worker, which executes an SQL query on a database, using Default, and sends the result set rows to a downstream worker.
Declaration
public AdbDataReaderSource(WorkerParent workerParent, string workerName, Func<bool> isStartableFunc, IAdbConnectionBuilder connectionBuilder, string queryText, Action<IColumnMapperCommand> columnMapperCommandAction)
Parameters
| Type | Name | Description |
|---|---|---|
| WorkerParent | workerParent | The parent worker or worker system that the new child worker will be added to. Cannot be |
| String | workerName | Name of the worker.
Set to a prefix plus a trailing
While less useful, set to
The name cannot otherwise contain |
| Func<Boolean> | isStartableFunc | Function to calculate the worker start constraint; it should return |
| IAdbConnectionBuilder | connectionBuilder | The connection builder, must not be |
| String | queryText | The query text, must not be |
| Action<IColumnMapperCommand> | columnMapperCommandAction | An action that executes commands that define the column mappings, e.g. mapping two columns using from-name and to-index:
Column name matching is ordinal case insensitive, but a case sensitive match takes precedence over a case insensitive match. Also see the Dataflow Column Mapping and Mapping and Copying examples. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException |
|
| ArgumentException |
|
| ArgumentNullException |
|
| InvalidOperationException |
|
AdbDataReaderSource(WorkerParent, String, Func<Boolean>, IAdbConnectionBuilder, String, CommandBehavior, Action<IColumnMapperCommand>)
Initializes a new instance of the AdbDataReaderSource<TOutput> dataflow worker, which executes an SQL query on a database, and sends the result set rows to a downstream worker.
Declaration
public AdbDataReaderSource(WorkerParent workerParent, string workerName, Func<bool> isStartableFunc, IAdbConnectionBuilder connectionBuilder, string queryText, CommandBehavior commandBehavior, Action<IColumnMapperCommand> columnMapperCommandAction)
Parameters
| Type | Name | Description |
|---|---|---|
| WorkerParent | workerParent | The parent worker or worker system that the new child worker will be added to. Cannot be |
| String | workerName | Name of the worker.
Set to a prefix plus a trailing
While less useful, set to
The name cannot otherwise contain |
| Func<Boolean> | isStartableFunc | Function to calculate the worker start constraint; it should return |
| IAdbConnectionBuilder | connectionBuilder | The connection builder, must not be |
| String | queryText | The query text, must not be |
| CommandBehavior | commandBehavior | The database command behavior. |
| Action<IColumnMapperCommand> | columnMapperCommandAction | An action that executes commands that define the column mappings, e.g. mapping two columns using from-name and to-index:
Column name matching is ordinal case insensitive, but a case sensitive match takes precedence over a case insensitive match. Also see the Dataflow Column Mapping and Mapping and Copying examples. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException |
|
| ArgumentException |
|
| ArgumentNullException |
|
| InvalidOperationException |
|
Properties
CommandBuilder
Gets or sets the builder for the database command. Can only be set before the worker starts running.
Note: This property is thread-safe.
Declaration
public AdbCommandBuilder CommandBuilder { get; set; }
Property Value
| Type | Description |
|---|---|
| AdbCommandBuilder |
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | Cannot set the property after the worker has started running. |
Output
Gets the output port for sending rows to the downstream worker.
Declaration
public OutputPort<TOutput> Output { get; }
Property Value
| Type | Description |
|---|---|
| OutputPort<TOutput> |
Methods
RunAsync()
This method can be overridden to add custom functionality to the derived worker that runs before
and after the row processing. In this case, the base class base.RunAsync() must
be called for the worker to function correctly.
Typically, this worker is used without overriding this method.
Declaration
protected override async Task<OutcomeStatus> RunAsync()
Returns
| Type | Description |
|---|---|
| Task<OutcomeStatus> | A |