Search Results for

    Show / Hide Table of Contents

    Class AdbTableNonQueryWorker

    A worker that executes a query on a table-like object (e.g. table, view, or table-valued function) in an SQL database, e.g. truncate, drop, check if exists, delete all rows, etc.

    Requires the Adb provider to support IAdbTableCommandService when performing a DeleteRows, DropTable, DropView, IfExistsDropTable, IfExistsDropView, or TruncateTable command.

    Requires the Adb provider to support IAdbTableInformationService when performing an IfExistsError or IfNotExistsError command.

    Note that universal (e.g. ODBC) providers generally don't support at least IAdbTableCommandService out of box, see SQL Database Access for details, as well as HasTableCommandService and HasTableInformationService.

    Also see AdbExecuteNonQueryWorker and AdbExecuteScalarWorker<TResult>.

    Note: For DeleteRows this worker does participate in any transaction currently active on the connection.

    Inheritance
    Object
    WorkerParent
    WorkerBase
    WorkerBase<AdbTableNonQueryWorker>
    AdbTableNonQueryWorker
    Implements
    IDisposeOnFinished
    Inherited Members
    WorkerBase<AdbTableNonQueryWorker>.AddCompletedCallback(Func<AdbTableNonQueryWorker, OutcomeStatus, Task<OutcomeStatus>>)
    WorkerBase<AdbTableNonQueryWorker>.AddRanCallback(Func<AdbTableNonQueryWorker, OutcomeStatus, WorkerParentChildrenState, Task<OutcomeStatus>>)
    WorkerBase<AdbTableNonQueryWorker>.AddStartingCallback(Func<AdbTableNonQueryWorker, 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.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 AdbTableNonQueryWorker : WorkerBase<AdbTableNonQueryWorker>, IDisposeOnFinished

    Constructors

    AdbTableNonQueryWorker(WorkerParent, IAdbConnectionBuilder, AdbTableNonQueryOperation, String)

    Initializes a new instance of the AdbTableNonQueryWorker worker. It executes a query on a table-like object (i.e. table or view) in an SQL database, e.g. truncate, drop, check if exists, delete all rows etc.

    The worker name is generated automatically from the operation, table name, and an increasing number starting at 1.

    Declaration
    public AdbTableNonQueryWorker(WorkerParent workerParent, IAdbConnectionBuilder connectionBuilder, AdbTableNonQueryOperation tableNonQueryOperation, string compositeTableName)
    Parameters
    Type Name Description
    WorkerParent workerParent

    The parent worker or worker system that the new child worker will be added to. Cannot be null.

    IAdbConnectionBuilder connectionBuilder

    The connection builder, must not be null.

    AdbTableNonQueryOperation tableNonQueryOperation

    Which operation to perform: truncate table, drop table, check if table exists, delete all rows in table etc.

    String compositeTableName

    Table to operate on. Can be a composite name. Must not be null or whitespace.

    Exceptions
    Type Condition
    ArgumentException

    connectionBuilder:

    • The provider does not support executing IAdbTableCommandService table commands
    • The provider does not support executing IAdbTableInformationService table information commands
    ArgumentException
    • Workers with the same parent must have unique names.
    • Worker and worker system names cannot contain '/' or start with double underscore '__'.
    ArgumentNullException

    connectionBuilder or compositeTableName must not be null.

    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?

    AdbTableNonQueryWorker(WorkerParent, Func<Boolean>, IAdbConnectionBuilder, AdbTableNonQueryOperation, String)

    Initializes a new instance of the AdbTableNonQueryWorker worker. It executes a query on a table-like object (i.e. table or view) in an SQL database, e.g. truncate, drop, check if exists, delete all rows etc.

    The worker name is generated automatically from the operation, table name, and an increasing number starting at 1.

    Declaration
    public AdbTableNonQueryWorker(WorkerParent workerParent, Func<bool> isStartableFunc, IAdbConnectionBuilder connectionBuilder, AdbTableNonQueryOperation tableNonQueryOperation, string compositeTableName)
    Parameters
    Type Name Description
    WorkerParent workerParent

    The parent worker or worker system that the new child worker will be added to. Cannot be null.

    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.

    AdbTableNonQueryOperation tableNonQueryOperation

    Which operation to perform: truncate table, drop table, check if table exists, delete all rows in table etc.

    String compositeTableName

    Table to operate on. Can be a composite name. Must not be null or whitespace.

    Exceptions
    Type Condition
    ArgumentException

    connectionBuilder:

    • The provider does not support executing IAdbTableCommandService table commands
    • The provider does not support executing IAdbTableInformationService table information commands
    ArgumentException
    • Workers with the same parent must have unique names.
    • Worker and worker system names cannot contain '/' or start with double underscore '__'.
    ArgumentNullException

    connectionBuilder or compositeTableName must not be null.

    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?

    AdbTableNonQueryWorker(WorkerParent, String, IAdbConnectionBuilder, AdbTableNonQueryOperation, String)

    Initializes a new instance of the AdbTableNonQueryWorker worker. It executes a query on a table-like object (i.e. table or view) in an SQL database, e.g. truncate, drop, check if exists, delete all rows etc.

    Declaration
    public AdbTableNonQueryWorker(WorkerParent workerParent, string workerName, IAdbConnectionBuilder connectionBuilder, AdbTableNonQueryOperation tableNonQueryOperation, string compositeTableName)
    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.

    AdbTableNonQueryOperation tableNonQueryOperation

    Which operation to perform: truncate table, drop table, check if table exists, delete all rows in table etc.

    String compositeTableName

    Table to operate on. Can be a composite name. Must not be null or whitespace.

    Exceptions
    Type Condition
    ArgumentException

    connectionBuilder:

    • The provider does not support executing IAdbTableCommandService table commands
    • The provider does not support executing IAdbTableInformationService table information commands
    ArgumentException

    workerName:

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

    connectionBuilder or compositeTableName must not be null.

    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?

    AdbTableNonQueryWorker(WorkerParent, String, Func<Boolean>, IAdbConnectionBuilder, AdbTableNonQueryOperation, String)

    Initializes a new instance of the AdbTableNonQueryWorker worker. It executes a query on a table-like object (i.e. table or view) in an SQL database, e.g. truncate, drop, check if exists, delete all rows etc.

    Declaration
    public AdbTableNonQueryWorker(WorkerParent workerParent, string workerName, Func<bool> isStartableFunc, IAdbConnectionBuilder connectionBuilder, AdbTableNonQueryOperation tableNonQueryOperation, string compositeTableName)
    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.

    AdbTableNonQueryOperation tableNonQueryOperation

    Which operation to perform: truncate table, drop table, check if table exists, delete all rows in table etc.

    String compositeTableName

    Table to operate on. Can be a composite name. Must not be null or whitespace.

    Exceptions
    Type Condition
    ArgumentException

    connectionBuilder:

    • The provider does not support executing IAdbTableCommandService table commands
    • The provider does not support executing IAdbTableInformationService table information commands
    ArgumentException

    workerName:

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

    connectionBuilder or compositeTableName must not be null.

    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

    RecordsAffected

    Gets the number of records affected by the query when deleting records. For all other types of statements (truncate etc.), the return value is -1. Only available after the worker has completed successfully.

    Note: This property is thread-safe.

    Declaration
    public int RecordsAffected { get; }
    Property Value
    Type Description
    Int32
    Exceptions
    Type Condition
    InvalidOperationException
    • Value only available after the worker has completed successfully.
    • Value not set.

    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

    See Also

    AdbTableNonQueryOperation
    AdbExecuteNonQueryWorker
    AdbExecuteScalarWorker<TResult>
    IAdbTableCommandService
    IAdbTableInformationService
    In This Article
    Back to top Copyright © 2021 Envobi Ltd