Search Results for

    Show / Hide Table of Contents

    Class AdbMySqlConnectorBulkInsertTarget<TInput>

    A dataflow worker that inserts all incoming records into a MySQL™ (or compatible) table or view using MySqlConnector.MySqlBulkCopy, which achieves high performance by loading records in bulk.

    Note that this worker requires an AdbMySqlConnectorProvider connection, see SQL Database Access for details.

    Also note that your connection string must include AllowLoadLocalInfile=true, see Using Load Data Local Infile for details.

    Implicit batches are formed every 16MiB since that's the maximum size of a single MySQL network packet.

    Note: This worker does participate in any transaction currently active on the connection.

    Note: Use the factory methods in AdbMySqlConnectorBulkInsertTargetFactory to create instances of this class.

    Inheritance
    Object
    WorkerParent
    WorkerBase
    WorkerBase<AdbMySqlConnectorBulkInsertTarget<TInput>>
    AdbMySqlConnectorBulkInsertTarget<TInput>
    Implements
    IDisposeOnFinished
    Inherited Members
    WorkerBase<AdbMySqlConnectorBulkInsertTarget<TInput>>.AddCompletedCallback(Func<AdbMySqlConnectorBulkInsertTarget<TInput>, OutcomeStatus, Task<OutcomeStatus>>)
    WorkerBase<AdbMySqlConnectorBulkInsertTarget<TInput>>.AddRanCallback(Func<AdbMySqlConnectorBulkInsertTarget<TInput>, OutcomeStatus, WorkerParentChildrenState, Task<OutcomeStatus>>)
    WorkerBase<AdbMySqlConnectorBulkInsertTarget<TInput>>.AddStartingCallback(Func<AdbMySqlConnectorBulkInsertTarget<TInput>, 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.MySqlConnectorExternal
    Assembly: actionETL.dll
    Syntax
    public class AdbMySqlConnectorBulkInsertTarget<TInput> : WorkerBase<AdbMySqlConnectorBulkInsertTarget<TInput>>, IDisposeOnFinished where TInput : class
    Type Parameters
    Name Description
    TInput

    The type of each Input row.

    Properties

    BulkCopyTimeout

    Gets or sets the database timeout in seconds. Cannot be set after the worker has started running.

    Note: This property is thread-safe.

    Declaration
    public int BulkCopyTimeout { get; set; }
    Property Value
    Type Description
    Int32

    The bulk copy timeout. Set to 0 to disable the timeout (the default).

    Exceptions
    Type Condition
    InvalidOperationException

    Cannot set the value after the worker has started running.

    CompositeTableName

    Gets or sets the composite name of the table to insert into. The string must have a format appropriate for the data source. E.g. for MySql:

    product
    myschema.product
    `sales`.`internet sales`
    "sales"."internet sales"

    Cannot be set after the worker has started running.

    Note: This property is thread-safe.

    Declaration
    public string CompositeTableName { get; set; }
    Property Value
    Type Description
    String

    The composite name of the table.

    Exceptions
    Type Condition
    InvalidOperationException

    Cannot set the value after the worker has started running.

    ConnectionBuilder

    Gets or sets the MySQL compatible database connection builder. Cannot be set after the worker has started running.

    Note: This property is thread-safe.

    Declaration
    public IAdbConnectionBuilder ConnectionBuilder { get; set; }
    Property Value
    Type Description
    IAdbConnectionBuilder
    Exceptions
    Type Condition
    InvalidOperationException

    Cannot set the value after the worker has started running.

    Input

    Gets the input port for receiving rows from an upstream worker.

    Declaration
    public InputPort<TInput> Input { get; }
    Property Value
    Type Description
    InputPort<TInput>

    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

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