Target Workers
A target worker has at least one input port, but no data output ports. It consumes the input data rows, and typically loads them to an external target, such as a database, a file, a .NET collection etc.
Note
- The library user instantiates targets via factory methods, see Worker Instantiation for details
- The type parameters describe what ports the transform has, e.g.
*Error*
means it has an error output port
Also see Source Workers and Transform Workers, as well as Non-Dataflow Workers.
ActionTarget
Execute an Action
or Func
callback once, which consumes rows from the upstream worker.
- Factory: ActionTargetFactory
- Workers:
- Example: Custom Dataflow Target
AdbExecuteNonQueryTarget
Execute an SQL query for each incoming row.
- Factory: AdbExecuteNonQueryTargetFactory
- Worker: AdbExecuteNonQueryTarget<TInputError>
AdbInsertTarget
Inserts incoming rows into an SQL table or view.
- Factory: AdbInsertTargetFactory
- Worker: AdbInsertTarget<TInputError>
- Examples:
AdbMySqlConnectorBulkInsertTarget
High performance bulk insert of incoming records into a MySQL compatible (i.e. including MariaDB) table or view using MySqlConnector.MySqlBulkCopy.
- Factory: AdbMySqlConnectorBulkInsertTargetFactory
- Worker: AdbMySqlConnectorBulkInsertTarget<TInput>
- Examples:
- See the similar
AdbInsertTarget
in SQL Database Access and column mapping examples - See the similar
AdbSqlClientBulkInsertTarget
in Slowly Changing Dimension Example
- See the similar
AdbSqlClientBulkInsertTarget
High performance bulk insert of incoming records into a SQL Server table or non-partitioned view using SqlBulkCopy.
- Factory: AdbSqlClientBulkInsertTargetFactory
- Worker: AdbSqlClientBulkInsertTarget<TInput>
- Examples:
- See the similar
AdbInsertTarget
in SQL Database Access and column mapping examples - Slowly Changing Dimension Example
- See the similar
CollectionTarget
Consume incoming rows from the upstream worker and add them to an ICollection<T>.
- Factory: CollectionTargetFactory
- Workers:
- Examples:
DictionaryTarget
Consume incoming rows from the upstream worker and add them to an IDictionary<TKey,TValue> by selecting a key and value pair for each row.
- Factory: DictionaryTargetFactory
- Worker: DictionaryTarget<TInput, TKey, TValue>
- Example: Used in the same way as this
AdbInsertTarget example,
except it uses key and value pairs (instead of whole rows), see the
selectKeyValueFunc
parameter in DictionaryTargetFactory.
FileHelperFileTarget
, FileHelperStreamTarget
Write incoming rows as delimited (e.g. CSV) or fixed format data to a file, or to a Stream. Also see CSV Delimited and Fixed Format.
- Factories:
- Workers:
- Examples:
PortPassThroughTarget
Pass rows from a child worker input port to a parent worker output port. Used when encapsulating dataflow workers inside parent dataflow workers.
- Factory: PortPassThroughTargetFactory
- Worker: PortPassThroughTarget<TInputOutput>
- Example: Custom Dataflow Pass-through Workers
RowActionTarget
Execute an Action
or Func
callback for each input row.
- Factory: RowActionTargetFactory
- Worker: RowActionTarget<TInput>
- Example: Custom Dataflow Target
RowsActionTarget
Execute an Action
or Func
callback when there are rows to consume from the upstream worker.
- Factory: RowsActionTargetFactory
- Worker: RowsActionTarget<TInput>
- Examples:
RowsTargetBase
Execute a virtual method when there are input rows available. Must be inherited.
- Workers:
- Example: Custom Dataflow Target
RowTargetBase
, RowWithErrorTargetBase
Execute a virtual method for each input row, with or without an ErrorOutput
port.
Must be inherited.
- Workers:
- Example: Custom Dataflow Target
TargetBase
A worker with one input for deriving dataflow targets. Must be inherited.
- Workers:
- Examples:
TrashTarget
Consume and discard all incoming rows.
- Factory: TrashTargetFactory
- Worker: TrashTarget<TInput>
- Examples: Configuration example 1 and example 2
XlsxTarget
Writes incoming rows to an XLSX spreadsheet file. Does not require any driver installation. Also see XLSX (Excel) Spreadsheets.
- Factory: XlsxTargetFactory
- Worker: XlsxTarget<TInput>
- Examples: