DbTypeCheck<TInput>
Class DbTypeCheck<TInput>
This component will check all properties of incoming records for type consistency against their corresponding columns in an existing database table. Flawed records can be redirected by using the LinkFlawedTo(IDataFlowDestination<TInput>) methods. Alternatively, a flawed record will either throw an exception, or the record can be redirected as an ETLBoxError using LinkErrorTo(..)
Implements
Inherited Members
Namespace: ETLBox.DataFlow
Assembly: ETLBox.dll
Syntax
Type Parameters
Name | Description |
---|---|
TInput |
Constructors
DbTypeCheck()
Declaration
DbTypeCheck(IConnectionManager, string)
Declaration
Parameters
Type | Name | Description |
---|---|---|
IConnectionManager | connectionManager | |
string | tableName |
DbTypeCheck(string)
Declaration
Parameters
Type | Name | Description |
---|---|---|
string | tableName |
Properties
AllPropertiesMustMatch
When true, marks a row as flawed if any property in the record does not map to a table column.
Declaration
Property Value
Type | Description |
---|---|
bool |
ColumnMapping
Maps properties in incoming rows to database columns. E.g., if the value of a property called "Id" should be compared to a database column called "Key", add a column mapping: DbColumnName: "Id" -> PropertyName: "Key".
Declaration
Property Value
Type | Description |
---|---|
ICollection<DbColumnMap> |
ConnectionManager
Manages database connections - use the right connection manager that fits with your database.
Declaration
Property Value
Type | Description |
---|---|
IConnectionManager |
CustomCheck
Allows for an additional custom check for each row beyond default type checks.
Declaration
Property Value
Type | Description |
---|---|
Predicate<TInput> |
FlawedSourceBlock
Internal output buffer block for flawed records.
Declaration
Property Value
Type | Description |
---|---|
ISourceBlock<TInput> |
IncludeBinaryLength
For binary/varbinary columns, marks records as flawed if the byte array length exceeds the column's max length.
Declaration
Property Value
Type | Description |
---|---|
bool |
IncludeCharLength
For char/varchar columns, marks records as flawed if the string length exceeds the column's max length.
Declaration
Property Value
Type | Description |
---|---|
bool |
IncludeIdentityColumn
Includes identity columns (a.k.a auto increment or serial columns) in type checks when set to true, otherwise ignores them.
Declaration
Property Value
Type | Description |
---|---|
bool |
SourceBlock
SourceBlock from the underlying TPL.Dataflow which is used as output buffer for the component.
Declaration
Property Value
Type | Description |
---|---|
ISourceBlock<TInput> |
Overrides
TableDefinition
Table definition of the destination table. By default, the table definition is read from the database using the given TableName. Use when automatic definition reading is not possible or only specific columns are needed for comparison.
Declaration
Property Value
Type | Description |
---|---|
TableDefinition |
TableName
Specifies the database table name for matching type definitions with incoming records.
Declaration
Property Value
Type | Description |
---|---|
string |
TargetBlock
TargetBlock from the underlying TPL.Dataflow which is used as input buffer for the component.
Declaration
Property Value
Type | Description |
---|---|
ITargetBlock<TInput> |
Overrides
Methods
AddAutomaticVoidLinkToOtherTargets(DataFlowComponent, IDataFlowDestination)
Declaration
Parameters
Type | Name | Description |
---|---|---|
DataFlowComponent | key | |
IDataFlowDestination | voidDest |
Overrides
CheckParameter()
Declaration
Overrides
CleanUpOnFaulted(Exception)
Declaration
Parameters
Type | Name | Description |
---|---|---|
Exception | e |
Overrides
CleanUpOnSuccess()
Declaration
Overrides
InitCheckedParameter()
Declaration
Overrides
InitComponent()
Declaration
Overrides
LinkFlawedTo(IDataFlowDestination<TInput>)
Establishes a link from the current block to another transformation or destination. This linked component will exclusively receive the flawed records detected by the current block.
Declaration
Parameters
Type | Name | Description |
---|---|---|
IDataFlowDestination<TInput> | target | The transformation or destination to which this block is linked. |
Returns
Type | Description |
---|---|
IDataFlowSource<TInput> | The component to which the duplicates are linked. |
LinkFlawedTo(IDataFlowDestination<TInput>, Predicate<TInput>)
Establishes a link from the current block to another transformation or destination. This linked component will exclusively receive the flawed records detected by the current block.
Declaration
Parameters
Type | Name | Description |
---|---|---|
IDataFlowDestination<TInput> | target | The transformation or destination to which this block is linked. |
Predicate<TInput> | rowsToKeep | A predicate to determine which rows to send to the connected target. Rows that satisfy this predicate (evaluate to true) are forwarded. |
Returns
Type | Description |
---|---|
IDataFlowSource<TInput> | The component to which the duplicates are linked. |
LinkFlawedTo(IDataFlowDestination<TInput>, Predicate<TInput>, Predicate<TInput>)
Establishes a link from the current block to another transformation or destination. This linked component will exclusively receive the flawed rows by the current block.
Declaration
Parameters
Type | Name | Description |
---|---|---|
IDataFlowDestination<TInput> | target | The transformation or destination to which this block is linked. |
Predicate<TInput> | rowsToKeep | A predicate to determine which rows to send to the connected target. Rows that satisfy this predicate (evaluate to true) are forwarded. |
Predicate<TInput> | rowsIntoVoid | A predicate to filter out rows. Rows that satisfy this predicate (evaluate to true) are discarded. |
Returns
Type | Description |
---|---|
IDataFlowSource<TInput> | The component to which the duplicates are linked. |