Search Results for

    Show / Hide Table of Contents

    Class AdbMySqlConnectorBulkInsertTargetFactory

    Factory methods that create an AdbMySqlConnectorBulkInsertTarget<TInput>(in DownstreamFactory<TInput>, String, Action<IColumnMapperCommand>, IAdbConnectionBuilder, String) dataflow worker, which 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.

    The Input port is linked to (if available) the upstream output or error output port specified by the factory.

    Get the factory from Link when the upstream port is known ahead of time (which is usually the case). Otherwise get it from GetDownstreamFactory<TInput>(), and link the transform or target explicitly using LinkTo(InputPort<TOutput>) or LinkFrom(OutputPortBase<TInput>).

    Inheritance
    Object
    AdbMySqlConnectorBulkInsertTargetFactory
    Namespace: actionETL.Adb.MySqlConnectorExternal
    Assembly: actionETL.dll
    Syntax
    public static class AdbMySqlConnectorBulkInsertTargetFactory

    Methods

    AdbMySqlConnectorBulkInsertTarget<TInput>(in DownstreamFactory<TInput>, String, Action<IColumnMapperCommand>, IAdbConnectionBuilder, String)

    Initializes a new instance of the AdbMySqlConnectorBulkInsertTarget<TInput>(in DownstreamFactory<TInput>, String, Action<IColumnMapperCommand>, IAdbConnectionBuilder, String) dataflow worker, which inserts all incoming records into a MySQL™ (or compatible) table or view using MySqlConnector.MySqlBulkCopy, which achieves high performance by loading records in bulk.

    The Input port is linked to (if available) the upstream output or error output port specified by the factory.

    Declaration
    public static AdbMySqlConnectorBulkInsertTarget<TInput> AdbMySqlConnectorBulkInsertTarget<TInput>(this in DownstreamFactory<TInput> downstreamFactory, string workerName, Action<IColumnMapperCommand> columnMapperCommandAction, IAdbConnectionBuilder mySqlConnectionBuilder, string compositeTableName)
        where TInput : class
    Parameters
    Type Name Description
    DownstreamFactory<TInput> downstreamFactory

    The downstream factory, which specifies the parent worker and (optionally) the upstream port to link the "first" input port of this dataflow worker to.

    Get it from Link when the upstream port is known ahead of time (which is usually the case). Otherwise get it from GetDownstreamFactory<TInput>(), and link the transform or target explicitly using LinkTo(InputPort<TOutput>) or LinkFrom(OutputPortBase<TInput>).

    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 "__".

    Action<IColumnMapperCommand> columnMapperCommandAction

    Defines mappings between external database columns and output columns.

    Column name matching is ordinal case insensitive, but a case sensitive match takes precedence over a case insensitive match.

    Also see Dataflow Column Mapping.

    IAdbConnectionBuilder mySqlConnectionBuilder

    The connection builder for a MySQL compatible database.

    String compositeTableName

    Name of the table to insert into. The string must have a format appropriate for the MySql data source, e.g.:

    product
    myschema.product
    `sales`.`internet sales`
    "sales"."internet sales"
    Returns
    Type Description
    AdbMySqlConnectorBulkInsertTarget<TInput>

    The newly created and (optionally) linked worker.

    Type Parameters
    Name Description
    TInput

    The type of each Input and ErrorOutput row.

    Exceptions
    Type Condition
    ArgumentException

    mySqlConnectionBuilder - 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

    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?

    See Also

    AdbMySqlConnectorBulkInsertTarget<TInput>(in DownstreamFactory<TInput>, String, Action<IColumnMapperCommand>, IAdbConnectionBuilder, String)
    In This Article
    Back to top Copyright © 2023 Envobi Ltd