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
Implements
Inherited Members
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 |
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 |
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 |