Class DbDestination<TInput>
A DbDestination represents a database table where ingoing data from the flow is written into. Inserts are done in batches (using Bulk insert or an equivalent INSERT statement).
Inheritance
Inherited Members
Namespace: ETLBox.DataFlow.Connectors
Assembly: ETLBox.dll
Syntax
public class DbDestination<TInput> : DataFlowBatchDestination<TInput>, ILoggableTask, IDataFlowLogging, IDataFlowBatchDestination<TInput>, IDataFlowDestination<TInput>, IDataFlowDestination, IDataFlowComponent, IDataFlowBatchDestination
Type Parameters
Name | Description |
---|---|
TInput | Data type for ingoing data, preferably representing the data type for the destination table. |
Constructors
DbDestination()
Declaration
public DbDestination()
DbDestination(IConnectionManager, String)
Declaration
public DbDestination(IConnectionManager connectionManager, string tableName)
Parameters
Type | Name | Description |
---|---|---|
IConnectionManager | connectionManager | Sets the ConnectionManager |
System.String | tableName | Sets the TableName |
DbDestination(IConnectionManager, String, Int32)
Declaration
public DbDestination(IConnectionManager connectionManager, string tableName, int batchSize)
Parameters
Type | Name | Description |
---|---|---|
IConnectionManager | connectionManager | Sets the ConnectionManager |
System.String | tableName | Sets the TableName |
System.Int32 | batchSize | Sets the BatchSize |
DbDestination(String)
Declaration
public DbDestination(string tableName)
Parameters
Type | Name | Description |
---|---|---|
System.String | tableName | Sets the TableName |
DbDestination(String, Int32)
Declaration
public DbDestination(string tableName, int batchSize)
Parameters
Type | Name | Description |
---|---|---|
System.String | tableName | Sets the TableName |
System.Int32 | batchSize | Sets the BatchSize |
Properties
AllowIdentityInsert
By default, identity columns (a.k.a auto increment or serial columns) are ignored when writing into the destination. If set to true, the DbDestination will try to overwrite identity values (if there is a corresponding property with a new id value in the data object)
Declaration
public bool AllowIdentityInsert { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
BulkInsertConnectionManager
The connection manager used for the bulk inserts. This is a copy of the provided connection manager.
Declaration
public IConnectionManager BulkInsertConnectionManager { get; protected set; }
Property Value
Type | Description |
---|---|
IConnectionManager |
ColumnConverters
Use a column converter to apply a conversion function to each value of a column.
Declaration
public ICollection<ColumnConverter> ColumnConverters { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.ICollection<ColumnConverter> |
ColumnMapping
Column mapping to map property to column names. E.g. if the value of property "Id" should be written into the database column "Key", then you can simply add a column mapping: DbColumnName: "Id" -> PropertyName: "Key".
Declaration
public ICollection<ColumnMap> ColumnMapping { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.ICollection<ColumnMap> |
ConnectionManager
The connection manager used to connect to the database - use the right connection manager for your database type.
Declaration
public virtual IConnectionManager ConnectionManager { get; set; }
Property Value
Type | Description |
---|---|
IConnectionManager |
DestinationTableDefinition
The table definition of the destination table. By default, the table definition is read from the database. Provide a table definition if the definition of the target can't be read automatically or you want the DbDestination only to use the columns in the provided definition.
Declaration
public TableDefinition DestinationTableDefinition { get; set; }
Property Value
Type | Description |
---|---|
TableDefinition |
TableName
Name of the database table that receives the data from the data flow.
Declaration
public string TableName { get; set; }
Property Value
Type | Description |
---|---|
System.String |
TaskName
A name to identify the task or component. Every component or task comes with a default name that can be overwritten.
Declaration
public override string TaskName { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Overrides
Methods
BulkInsertData(TInput[])
Declaration
protected override void BulkInsertData(TInput[] data)
Parameters
Type | Name | Description |
---|---|---|
TInput[] | data |
Overrides
CheckParameter()
Declaration
protected override void CheckParameter()
Overrides
FinishWrite()
Declaration
protected override void FinishWrite()
Overrides
PrepareParameter()
Declaration
protected override void PrepareParameter()
Overrides
PrepareWrite()
Declaration
protected override void PrepareWrite()