Search Results for

    Show / Hide Table of Contents

    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.

    Inheritance
    Object
    WorkerParent
    WorkerBase
    WorkerBase<AdbDataReaderSource<TOutput>>
    AdbDataReaderSource<TOutput>
    Implements
    IDisposeOnFinished
    Inherited Members
    WorkerBase<AdbDataReaderSource<TOutput>>.AddCompletedCallback(Func<AdbDataReaderSource<TOutput>, OutcomeStatus, Task<OutcomeStatus>>)
    WorkerBase<AdbDataReaderSource<TOutput>>.AddRanCallback(Func<AdbDataReaderSource<TOutput>, OutcomeStatus, WorkerParentChildrenState, Task<OutcomeStatus>>)
    WorkerBase<AdbDataReaderSource<TOutput>>.AddStartingCallback(Func<AdbDataReaderSource<TOutput>, Task<ProgressStatus>>)
    WorkerBase.AddCompletedCallback(Func<WorkerBase, OutcomeStatus, Task<OutcomeStatus>>)
    WorkerBase.AddRanCallback(Func<WorkerBase, OutcomeStatus, WorkerParentChildrenState, Task<OutcomeStatus>>)
    WorkerBase.AddStartingCallback(Func<WorkerBase, Task<ProgressStatus>>)
    WorkerBase.DefaultIsStartable()
    WorkerBase.ErroredPortErrorsWorkerProtected
    WorkerBase.ErrorOutputs
    WorkerBase.EscalateError
    WorkerBase.Inputs
    WorkerBase.IsStartable
    WorkerBase.Outputs
    WorkerBase.Parent
    WorkerBase.SucceededSequence<TLastWorker>(WorkerBase, WorkerBase, WorkerBase, WorkerBase, WorkerBase, TLastWorker)
    WorkerBase.SucceededSequence<TLastWorker>(WorkerBase, WorkerBase, WorkerBase, WorkerBase, TLastWorker)
    WorkerBase.SucceededSequence<TLastWorker>(WorkerBase, WorkerBase, WorkerBase, TLastWorker)
    WorkerBase.SucceededSequence<TLastWorker>(WorkerBase, WorkerBase, TLastWorker)
    WorkerBase.SucceededSequence<TLastWorker>(WorkerBase, TLastWorker)
    WorkerBase.SucceededSequence<TLastWorker>(TLastWorker)
    WorkerParent.AddChildCompletedCallback(Action<WorkerBase>)
    WorkerParent.AddStartingChildrenCallback(Func<WorkerParent, Task<ProgressStatus>>)
    WorkerParent.BytesPerRowBuffer
    WorkerParent.Children
    WorkerParent.DisposeOnFinished<TDisposable>(TDisposable)
    WorkerParent.GetDownstreamFactory<TInput>()
    WorkerParent.HasChildren
    WorkerParent.IsCanceled
    WorkerParent.IsCompleted
    WorkerParent.IsCreated
    WorkerParent.IsError
    WorkerParent.IsFailed
    WorkerParent.IsFatal
    WorkerParent.IsRunning
    WorkerParent.IsSucceeded
    WorkerParent.KeepChildrenLevels
    WorkerParent.Locator
    WorkerParent.LogFactory
    WorkerParent.Logger
    WorkerParent.MaxRunningChildren
    WorkerParent.Name
    WorkerParent.RemoveChildren()
    WorkerParent.RescheduleChildren()
    WorkerParent.RunChildrenAsync(Boolean)
    WorkerParent.RunChildrenAsync()
    WorkerParent.Status
    WorkerParent.Item[String]
    WorkerParent.ToString()
    WorkerParent.WorkerSystem
    WorkerParent.DebugCommands
    WorkerParent.AggregateErrorOutputRows
    WorkerParent.AggregateOutputRows
    WorkerParent.AggregateWorkersCompleted
    WorkerParent.InstantCompleted
    WorkerParent.InstantCreated
    WorkerParent.InstantStarted
    WorkerParent.RunningDuration
    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 Output row.

    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 null.

    String workerName

    Name of the worker.

    Set to a prefix plus a trailing "/" (e.g. "MyPrefix-/") to generate a unique name from the prefix plus an increasing number starting at 1.

    While less useful, set to null, whitespace or "/" to generate a unique name from the worker type plus an increasing number starting at 1.

    The name cannot otherwise contain "/", and cannot start with double underscore "__".

    AdbCommandBuilder commandBuilder

    A builder for the database command. Can be null, in which case CommandBuilder must be set before the worker starts running.

    Action<IColumnMapperCommand> columnMapperCommandAction

    An action that executes commands that define the column mappings, e.g. mapping two columns using from-name and to-index:

    cbc => cbc.Name("ColumnA", "0").Name("ColumnB", "1")

    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

    commandBuilder

    ArgumentException

    workerName:

    • Workers with the same parent must have unique names.
    • Worker and worker system names cannot contain '/' or start with double underscore '__'.
    ArgumentNullException

    workerParent - All workers must have a parent. The top level workers have the worker system as parent.

    InvalidOperationException
    • Cannot add child worker to parent which has completed. Are you adding it to the correct parent?
    • Cannot add worker to parent, since its children have been started. Are you adding it to the correct parent?

    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 null.

    String workerName

    Name of the worker.

    Set to a prefix plus a trailing "/" (e.g. "MyPrefix-/") to generate a unique name from the prefix plus an increasing number starting at 1.

    While less useful, set to null, whitespace or "/" to generate a unique name from the worker type plus an increasing number starting at 1.

    The name cannot otherwise contain "/", and cannot start with double underscore "__".

    AdbCommandBuilder commandBuilder

    A builder for the database command. Can be null, in which case CommandBuilder must be set before the worker starts running.

    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:

    cbc => cbc.Name("ColumnA", "0").Name("ColumnB", "1")

    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

    commandBuilder

    ArgumentException

    workerName:

    • Workers with the same parent must have unique names.
    • Worker and worker system names cannot contain '/' or start with double underscore '__'.
    ArgumentNullException

    workerParent - All workers must have a parent. The top level workers have the worker system as parent.

    InvalidOperationException
    • Cannot add child worker to parent which has completed. Are you adding it to the correct parent?
    • Cannot add worker to parent, since its children have been started. Are you adding it to the correct parent?

    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 null.

    String workerName

    Name of the worker.

    Set to a prefix plus a trailing "/" (e.g. "MyPrefix-/") to generate a unique name from the prefix plus an increasing number starting at 1.

    While less useful, set to null, whitespace or "/" to generate a unique name from the worker type plus an increasing number starting at 1.

    The name cannot otherwise contain "/", and cannot start with double underscore "__".

    IAdbConnectionBuilder connectionBuilder

    The connection builder, must not be null.

    String queryText

    The query text, must not be null.

    Action<IColumnMapperCommand> columnMapperCommandAction

    An action that executes commands that define the column mappings, e.g. mapping two columns using from-name and to-index:

    cbc => cbc.Name("ColumnA", "0").Name("ColumnB", "1")

    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
    • connectionBuilder
    • queryText
    ArgumentException

    workerName:

    • Workers with the same parent must have unique names.
    • Worker and worker system names cannot contain '/' or start with double underscore '__'.
    ArgumentNullException

    workerParent - All workers must have a parent. The top level workers have the worker system as parent.

    InvalidOperationException
    • Cannot add child worker to parent which has completed. Are you adding it to the correct parent?
    • Cannot add worker to parent, since its children have been started. Are you adding it to the correct parent?

    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 null.

    String workerName

    Name of the worker.

    Set to a prefix plus a trailing "/" (e.g. "MyPrefix-/") to generate a unique name from the prefix plus an increasing number starting at 1.

    While less useful, set to null, whitespace or "/" to generate a unique name from the worker type plus an increasing number starting at 1.

    The name cannot otherwise contain "/", and cannot start with double underscore "__".

    IAdbConnectionBuilder connectionBuilder

    The connection builder, must not be null.

    String queryText

    The query text, must not be null.

    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:

    cbc => cbc.Name("ColumnA", "0").Name("ColumnB", "1")

    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
    • connectionBuilder
    • queryText
    ArgumentException

    workerName:

    • Workers with the same parent must have unique names.
    • Worker and worker system names cannot contain '/' or start with double underscore '__'.
    ArgumentNullException

    workerParent - All workers must have a parent. The top level workers have the worker system as parent.

    InvalidOperationException
    • Cannot add child worker to parent which has completed. Are you adding it to the correct parent?
    • Cannot add worker to parent, since its children have been started. Are you adding it to the correct parent?

    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 null.

    String workerName

    Name of the worker.

    Set to a prefix plus a trailing "/" (e.g. "MyPrefix-/") to generate a unique name from the prefix plus an increasing number starting at 1.

    While less useful, set to null, whitespace or "/" to generate a unique name from the worker type plus an increasing number starting at 1.

    The name cannot otherwise contain "/", and cannot start with double underscore "__".

    Func<Boolean> isStartableFunc

    Function to calculate the worker start constraint; it should return true for startable and false for not startable. Defaults to startable if null.

    AdbCommandBuilder commandBuilder

    A builder for the database command. Can be null, in which case CommandBuilder must be set before the worker starts running.

    Action<IColumnMapperCommand> columnMapperCommandAction

    An action that executes commands that define the column mappings, e.g. mapping two columns using from-name and to-index:

    cbc => cbc.Name("ColumnA", "0").Name("ColumnB", "1")

    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

    commandBuilder

    ArgumentException

    workerName:

    • Workers with the same parent must have unique names.
    • Worker and worker system names cannot contain '/' or start with double underscore '__'.
    ArgumentNullException

    workerParent - All workers must have a parent. The top level workers have the worker system as parent.

    InvalidOperationException
    • Cannot add child worker to parent which has completed. Are you adding it to the correct parent?
    • Cannot add worker to parent, since its children have been started. Are you adding it to the correct parent?

    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 null.

    String workerName

    Name of the worker.

    Set to a prefix plus a trailing "/" (e.g. "MyPrefix-/") to generate a unique name from the prefix plus an increasing number starting at 1.

    While less useful, set to null, whitespace or "/" to generate a unique name from the worker type plus an increasing number starting at 1.

    The name cannot otherwise contain "/", and cannot start with double underscore "__".

    Func<Boolean> isStartableFunc

    Function to calculate the worker start constraint; it should return true for startable and false for not startable. Defaults to startable if null.

    AdbCommandBuilder commandBuilder

    A builder for the database command. Can be null, in which case CommandBuilder must be set before the worker starts running.

    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:

    cbc => cbc.Name("ColumnA", "0").Name("ColumnB", "1")

    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

    commandBuilder

    ArgumentException

    workerName:

    • Workers with the same parent must have unique names.
    • Worker and worker system names cannot contain '/' or start with double underscore '__'.
    ArgumentNullException

    workerParent - All workers must have a parent. The top level workers have the worker system as parent.

    InvalidOperationException
    • Cannot add child worker to parent which has completed. Are you adding it to the correct parent?
    • Cannot add worker to parent, since its children have been started. Are you adding it to the correct parent?

    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 null.

    String workerName

    Name of the worker.

    Set to a prefix plus a trailing "/" (e.g. "MyPrefix-/") to generate a unique name from the prefix plus an increasing number starting at 1.

    While less useful, set to null, whitespace or "/" to generate a unique name from the worker type plus an increasing number starting at 1.

    The name cannot otherwise contain "/", and cannot start with double underscore "__".

    Func<Boolean> isStartableFunc

    Function to calculate the worker start constraint; it should return true for startable and false for not startable. Defaults to startable if null.

    IAdbConnectionBuilder connectionBuilder

    The connection builder, must not be null.

    String queryText

    The query text, must not be null.

    Action<IColumnMapperCommand> columnMapperCommandAction

    An action that executes commands that define the column mappings, e.g. mapping two columns using from-name and to-index:

    cbc => cbc.Name("ColumnA", "0").Name("ColumnB", "1")

    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
    • connectionBuilder
    • queryText
    ArgumentException

    workerName:

    • Workers with the same parent must have unique names.
    • Worker and worker system names cannot contain '/' or start with double underscore '__'.
    ArgumentNullException

    workerParent - All workers must have a parent. The top level workers have the worker system as parent.

    InvalidOperationException
    • Cannot add child worker to parent which has completed. Are you adding it to the correct parent?
    • Cannot add worker to parent, since its children have been started. Are you adding it to the correct parent?

    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 null.

    String workerName

    Name of the worker.

    Set to a prefix plus a trailing "/" (e.g. "MyPrefix-/") to generate a unique name from the prefix plus an increasing number starting at 1.

    While less useful, set to null, whitespace or "/" to generate a unique name from the worker type plus an increasing number starting at 1.

    The name cannot otherwise contain "/", and cannot start with double underscore "__".

    Func<Boolean> isStartableFunc

    Function to calculate the worker start constraint; it should return true for startable and false for not startable. Defaults to startable if null.

    IAdbConnectionBuilder connectionBuilder

    The connection builder, must not be null.

    String queryText

    The query text, must not be null.

    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:

    cbc => cbc.Name("ColumnA", "0").Name("ColumnB", "1")

    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
    • connectionBuilder
    • queryText
    ArgumentException

    workerName:

    • Workers with the same parent must have unique names.
    • Worker and worker system names cannot contain '/' or start with double underscore '__'.
    ArgumentNullException

    workerParent - All workers must have a parent. The top level workers have the worker system as parent.

    InvalidOperationException
    • Cannot add child worker to parent which has completed. Are you adding it to the correct parent?
    • Cannot add worker to parent, since its children have been started. Are you adding it to the correct parent?

    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 Task describing the success or failure of the worker. An asynchronous async implementation would e.g. return OutcomeStatus.Succeeded on success, while a synchronous implementation would return OutcomeStatus.SucceededTask.

    Overrides
    WorkerParent.RunAsync()

    Implements

    IDisposeOnFinished
    In This Article
    Back to top Copyright © 2023 Envobi Ltd