Namespace actionETL.Adb.SqlClientExternal
Contains the Adb database provider and supporting services for SQL Server® and its "Microsoft.Data.SqlClient" .NET database provider.
Classes
AdbSqlClientBulkInsertTarget<TInput>
A dataflow worker that inserts all incoming records into a SQL Server® table or non-partitioned view using SqlBulkCopy, which achieves high performance by loading records in bulk. Also see SqlBulkCopyColumnOrderHintCollection as well as Optimizing Bulk Import Performance.
Enabling TableLock improves performance significantly, but prohibits any other thread or process to access the table while the bulk copy is running.
Note that this worker requires an AdbSqlClientProvider connection, see SQL Database Access for details.
Note: Use the factory methods in AdbSqlClientBulkInsertTargetFactory to create instances of this class.
Note: This worker does participate in any transaction currently active on the connection.
AdbSqlClientBulkInsertTargetFactory
Factory methods that create an AdbSqlClientBulkInsertTarget<TInput> dataflow worker, which inserts all incoming records into a SQL Server® table or non-partitioned view using SqlBulkCopy, which achieves high performance by loading records in bulk. Also see SqlBulkCopyColumnOrderHintCollection as well as Optimizing Bulk Import Performance.
Enabling TableLock improves performance significantly, but prohibits any other thread or process to access the table while the bulk copy is running.
Note that this worker requires an AdbSqlClientProvider connection, see SQL Database Access for details.
Note: This worker does participate in any transaction currently active on the connection.
The Input port is linked to (if available) the upstream
output or error output port specified by the factory.
Get the factory from Link when the upstream port is known ahead of time (which is usually the case). Otherwise get it from GetDownstreamFactory<TInput>(), and link the transform or target explicitly using LinkTo(InputPort<TOutput>) or LinkFrom(OutputPortBase<TInput>).
AdbSqlClientDataSourceInformationService
Provides information about a SQL Server® data source behind a connection, such as what character to use for quoting, how to specify parameter markers etc. The information is mainly taken from the "DataSourceInformation" schema collection, and is used to write provider-independent database code.
This class is used when creating AdbProvider instances, use one of the Get() overloads to retrieve the required delegate.
This class can be inherited to overwrite some values, and used to create a custom
Microsoft.Data.SqlClient provider, see AdbSqlClientProvider and
Information for details.
This class is immutable. This avoids threading issues, since an instance is often accessed by multiple threads. Any user custom provider services should also be immutable for the same reason.
AdbSqlClientProvider
A static class where the Get() overloads return AdbProvider immutable instances that wrap the SQL Server® Microsoft.Data.SqlClient ADO.NET database provider, which assists with writing provider-independent code, mapping between .NET CLR types and database types, etc.
Use the retrieved AdbProvider instance to create AdbConnectionString, AdbConnectionBuilder, AdbKeepOpenConnectionBuilder and AdbCommandBuilder instances, or pass the provider instance to other methods for them to use it.
Note that it is best practice to select which provider(s) to use in only one place in the application, to make it easy to switch to a different provider instance, especially since settings such as how to quote identifiers is specified by creating the appropriate provider instance.
All Get() overloads return instances with
MaxRowsPerBatch
equal to 1000.
Each AdbProvider instance contains a set of services that implements the provider
functionality. You can create a new modified provider instance from an existing one by using
its With*() methods to replace one of its services.
Custom services can be derived from existing ones, or created from scratch.
Alternatively, create a custom provider by using the AdbProvider
constructor, specifying all the services.
This provider uses the following service classes:
- AdbSqlClientInsertStatementService
- AdbSqlClientDataSourceInformationService
- AdbSqlClientTableCommandService
- AdbSqlClientTableInformationService
- AdbSqlClientTypeMapper
- AdbSqlClientTypeService
See SQL Database Access for further details.
AdbSqlClientTableCommandService
For a SQL Server® Microsoft.Data.SqlClient data source,
implements an optional service that executes predefined table commands (truncate, drop, delete all rows).
This class is normally not used directly by the user, but instead via
TableCommand.
You can however derive from this class (or from a base or descendant class) to customize the
information for either the same .NET provider, or for a different but similar .NET provider.
Also see HasTableCommandService, AdbSqlClientTableInformationService, AdbSqlClientDataSourceInformationService, AdbConnection and AdbProvider.
AdbSqlClientTableInformationService
An optional service for a SQL Server® Microsoft.Data.SqlClient data source that
manipulates table identifiers and provides information about table-like objects,
such as which ones exists and what their type is (table, view, etc), and which
columns are present.
This assists with writing provider-independent database code, and is available as
TableInformation.
Also see HasTableInformationService, AdbSqlClientTableCommandService,
AdbSqlClientDataSourceInformationService, AdbConnection and
AdbProvider.
Derive from this class (or from a base or descendant class) to customize the information for either the same .NET provider, or for a different but similar .NET provider.
AdbSqlClientTypeMapper
Stores mappings between .NET types and database types, and allows setting the database type of database parameters from these mappings.
This class adds mappings for SQL Server® Microsoft.Data.SqlClient database types. See the
Data Type Mappings
, as well as AdbTypeMapper and
predefined type mappings
for further details.
This class can be derived from to create a customized provider that revises and adds mappings.
This class is immutable. This avoids threading issues, since an instance is often accessed by multiple threads. Any user custom provider services should also be immutable for the same reason.
AdbSqlClientTypeService
Gets and sets types and values on database parameters for a Microsoft.Data.SqlClient
provider for a SQL Server® data source, such as AdbSqlClientProvider.
This class is immutable. This avoids threading issues, since an instance is often accessed by multiple threads. Any user custom provider services should also be immutable for the same reason.