DbDestination<TInput>

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).

Inherited Members
Namespace: ETLBox.DataFlow
Assembly: ETLBox.dll
Syntax
    public class DbDestination<TInput> : DataFlowBatchDestination<TInput>, IDataFlowBatchDestination<TInput>, IDataFlowDestination<TInput>, IDataFlowBatchDestination, IDataFlowDestination, IDataFlowComponent, ILoggableTask
Type Parameters
NameDescription
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
TypeNameDescription
IConnectionManagerconnectionManager

Sets the ConnectionManager

stringtableName

Sets the TableName

DbDestination(IConnectionManager, string, int)

Declaration
    public DbDestination(IConnectionManager connectionManager, string tableName, int batchSize)
Parameters
TypeNameDescription
IConnectionManagerconnectionManager

Sets the ConnectionManager

stringtableName

Sets the TableName

intbatchSize

Sets the BatchSize

DbDestination(string)

Declaration
    public DbDestination(string tableName)
Parameters
TypeNameDescription
stringtableName

Sets the TableName

DbDestination(string, int)

Declaration
    public DbDestination(string tableName, int batchSize)
Parameters
TypeNameDescription
stringtableName

Sets the TableName

intbatchSize

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
TypeDescription
bool

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
TypeDescription
IConnectionManager

BulkOperation

The bulk operation mode used for inserting data. By default, the database will insert the arriving data into the destination table using bulk insert. You can use BulkOperation.Delete to bulk delete matching data in the destination. You can use BulkOperation.Update to bulk update matching data in the destination. IdColumns must match to delete a record. UpdateColumns define which columns are updated (all non id columns if no update columns is set).

Declaration
    public BulkOperation BulkOperation { get; set; }
Property Value
TypeDescription
BulkOperation

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
TypeDescription
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<DbColumnMap> ColumnMapping { get; set; }
Property Value
TypeDescription
ICollection<DbColumnMap>

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
TypeDescription
IConnectionManager

IdColumns

List of id columns that are used to identify matching records. Only needed when BulkOpteration is set to BulkOperation.Update or BulkOperation.Delete.

Declaration
    public ICollection<IdColumn> IdColumns { get; set; }
Property Value
TypeDescription
ICollection<IdColumn>

TableDefinition

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 TableDefinition { get; set; }
Property Value
TypeDescription
TableDefinition

TableName

Name of the database table that receives the data from the data flow.

Declaration
    public string TableName { get; set; }
Property Value
TypeDescription
string

UpdateColumns

List of columns that are are updated when BulkOperation is set to BulkOperation.Update

Declaration
    public ICollection<UpdateColumn> UpdateColumns { get; set; }
Property Value
TypeDescription
ICollection<UpdateColumn>

ValueGeneratedColumns

List of columns that contain information generated from the underlying database (e.g. identity/auto increment/serial columns, or columns with default values when inserting null). This information can be read for supported databases after bulk inserting the data.

Declaration
    public ICollection<ValueGenerationColumn> ValueGeneratedColumns { get; set; }
Property Value
TypeDescription
ICollection<ValueGenerationColumn>

Methods

BulkInsertData(TInput[])

Declaration
    protected override void BulkInsertData(TInput[] data)
Parameters
TypeNameDescription
TInput[]data
Overrides

CheckParameter()

Declaration
    protected override void CheckParameter()
Overrides

FinishWrite()

Declaration
    protected override void FinishWrite()
Overrides

PrepareParameterForCheck()

Declaration
    protected override void PrepareParameterForCheck()
Overrides

PrepareWrite()

Declaration
    protected override void PrepareWrite()
Overrides

Reset()

Declaration
    protected override void Reset()
Overrides

SkipRecord(string, string)

Declaration
    public bool SkipRecord(string propName, string colname)
Parameters
TypeNameDescription
stringpropName
stringcolname
Returns
TypeDescription
bool

Implements