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
Type Parameters
Name | Description |
---|---|
TInput | Data type for ingoing data, preferably representing the data type for the destination table. |
Constructors
DbDestination()
Declaration
DbDestination(IConnectionManager, string)
Declaration
Parameters
Type | Name | Description |
---|---|---|
IConnectionManager | connectionManager | Sets the ConnectionManager |
string | tableName | Sets the TableName |
DbDestination(IConnectionManager, string, int)
Declaration
Parameters
Type | Name | Description |
---|---|---|
IConnectionManager | connectionManager | Sets the ConnectionManager |
string | tableName | Sets the TableName |
int | batchSize | Sets the BatchSize |
DbDestination(string)
Declaration
Parameters
Type | Name | Description |
---|---|---|
string | tableName | Sets the TableName |
DbDestination(string, int)
Declaration
Parameters
Type | Name | Description |
---|---|---|
string | tableName | Sets the TableName |
int | 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
Property Value
Type | Description |
---|---|
bool |
BulkInsertConnectionManager
The connection manager used for the bulk inserts. This is a copy of the provided connection manager.
Declaration
Property Value
Type | Description |
---|---|
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
Property Value
Type | Description |
---|---|
BulkOperation |
ColumnConverters
Use a column converter to apply a conversion function to each value of a column.
Declaration
Property Value
Type | Description |
---|---|
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
Property Value
Type | Description |
---|---|
ICollection<DbColumnMap> |
ConnectionManager
The connection manager used to connect to the database - use the right connection manager for your database type.
Declaration
Property Value
Type | Description |
---|---|
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
Property Value
Type | Description |
---|---|
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
Property Value
Type | Description |
---|---|
TableDefinition |
TableName
Name of the database table that receives the data from the data flow.
Declaration
Property Value
Type | Description |
---|---|
string |
UpdateColumns
List of columns that are are updated when BulkOperation is set to BulkOperation.Update
Declaration
Property Value
Type | Description |
---|---|
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
Property Value
Type | Description |
---|---|
ICollection<ValueGenerationColumn> |
Methods
BulkInsertData(TInput[])
Declaration
Parameters
Type | Name | Description |
---|---|---|
TInput[] | data |
Overrides
CheckParameter()
Declaration
Overrides
FinishWrite()
Declaration
Overrides
PrepareParameterForCheck()
Declaration
Overrides
PrepareWrite()
Declaration
Overrides
Reset()
Declaration
Overrides
SkipRecord(string, string)
Declaration
Parameters
Type | Name | Description |
---|---|---|
string | propName | |
string | colname |
Returns
Type | Description |
---|---|
bool |