Search Results for

    Show / Hide Table of Contents

    Class AdbProvider

    Wraps an ADO.NET database provider and assists with writing provider independent code, mapping between .NET CLR types and database types, and instantiating AdbConnectionString, AdbConnectionBuilder, AdbKeepOpenConnectionBuilder, and AdbCommandBuilder instances.

    The user normally uses one of the out of box providers, e.g. AdbSqlClientProvider or AdbOdbcProvider, see SQL Database Access.

    Note that it is best practice to select which provider 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 picking or creating the appropriate provider instance.

    Each AdbProvider instance contains a set of services that implements the provider functionality. It is possible to tweak an existing provider by using its With*() methods to create a new provider instance with one or more services replaced. 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.

    Also note that IAdbInsertStatementService, IAdbTableCommandService and IAdbTableInformationService services are optional, and any workers that rely on a service that a particular provider does not supply are unsupported. See the documentation for the individual services for details.

    This class is immutable, which avoids threading issues, since the provider instance is often accessed by multiple threads. Individual services are either immutable (IAdbInsertStatementService, IAdbTypeMapper and IAdbTypeService), or are created on a per connection basis (IAdbDataSourceInformationService, IAdbTableCommandService and IAdbTableInformationService). Any user custom provider services must follow the same approach.

    Inheritance
    Object
    AdbProvider
    Namespace: actionETL.Adb
    Assembly: actionETL.dll
    Syntax
    public sealed class AdbProvider

    Constructors

    AdbProvider(String, DbProviderFactory, String, Func<IAdbConnection, IAdbDataSourceInformationService>, IAdbInsertStatementService, IAdbTypeMapper, IAdbTypeService, Func<IAdbConnection, IAdbTableInformationService>, Func<IAdbConnection, IAdbTableCommandService>)

    Initializes a new instance of the AdbProvider class, which wraps an ADO.NET database provider and assists with e.g. writing provider independent code, mapping between .NET CLR types and database types, and instantiating AdbConnectionString and other types.

    Declaration
    public AdbProvider(string providerInvariantName, DbProviderFactory underlyingProviderFactory, string description, Func<IAdbConnection, IAdbDataSourceInformationService> dataSourceInformationServiceFunc, IAdbInsertStatementService insertStatementService, IAdbTypeMapper typeMapper, IAdbTypeService typeService, Func<IAdbConnection, IAdbTableInformationService> tableInformationServiceFunc = null, Func<IAdbConnection, IAdbTableCommandService> tableCommandServiceFunc = null)
    Parameters
    Type Name Description
    String providerInvariantName

    The provider invariant name of the underlying .NET provider, e.g. "Microsoft.Data.SqlClient", see ProviderInvariantName. Note that this string is not used for looking up the database provider factory; instead underlyingProviderFactory is used.

    DbProviderFactory underlyingProviderFactory

    The underlying database provider factory. Cannot be null.

    String description

    A description of the Adb provider, or an empty string, or null to retain the same description. This is used mainly for informational purposes in logging etc. As a convention, this is a colon separated concatenation of ProviderInvariantName, the supported data source product(s), and any non-default settings. Separate multiple settings with underscore, in alphabetical order, and use equal sign to specify any values, e.g.:

    "Microsoft.Data.SqlClient:SQL Server:AnsiQuotes", "System.Data.Odbc:ODBC without TableInformation:", "System.Data.Odbc:SqlServer2005:", "System.Data.Odbc:PostgreSQL:AnsiQuotes_LongTimeout=120" etc.

    Func<IAdbConnection, IAdbDataSourceInformationService> dataSourceInformationServiceFunc

    A callback that returns a (usually provider-specific) data source information service instance.

    IAdbInsertStatementService insertStatementService

    The optional insert statement service, or null to not provide this service.

    IAdbTypeMapper typeMapper

    A (usually provider-specific) database type mapper.

    IAdbTypeService typeService

    A (usually provider-specific) database type service.

    Func<IAdbConnection, IAdbTableInformationService> tableInformationServiceFunc

    An optional callback that returns a (usually provider-specific) table information service instance, or null to not provide this service.

    Func<IAdbConnection, IAdbTableCommandService> tableCommandServiceFunc

    An optional callback that returns a (usually provider-specific) table command service instance, or null to not provide this service.

    Exceptions
    Type Condition
    ArgumentException
    • description - Must supply a non-empty value
    • providerInvariantName - Must supply a non-empty value
    • providerInvariantName - Unable to find the requested .Net Framework Data Provider. It may not be installed.
    ArgumentNullException
    • typeService
    • typeMapper

    Properties

    Description

    Gets the Adb provider description, which is used mainly for informational purposes in logging etc. As a convention, this is a colon separated concatenation of ProviderInvariantName, the supported data source product(s), and any non-default settings. Separate multiple settings with underscore, in alphabetical order, and use equal sign to specify any values, e.g.:

    "Microsoft.Data.SqlClient:SQL Server:AnsiQuotes", "System.Data.Odbc:ODBC without TableInformation:", "System.Data.Odbc:SqlServer2005:", "System.Data.Odbc:PostgreSQL:AnsiQuotes_LongTimeout=120" etc.

    Declaration
    public string Description { get; }
    Property Value
    Type Description
    String

    HasTableCommandService

    Returns true if this provider supports the TableCommand services; otherwise false. Use this value (or check if the TableCommand property is null if you have a connection) to determine if the table commands can be executed, or if the caller, typically a worker, should fail. Do fail as early as possible, e.g. prefer failing when creating a worker instead of when running it.

    Declaration
    public bool HasTableCommandService { get; }
    Property Value
    Type Description
    Boolean

    HasTableInformationService

    Returns true if this provider supports the TableInformation services; otherwise false. Use this value (or check if the TableInformation property is null if you have a connection) to determine if the table commands can be executed, or if the caller, typically a worker, should fail. Do fail as early as possible, e.g. prefer failing when creating a worker instead of when running it.

    Declaration
    public bool HasTableInformationService { get; }
    Property Value
    Type Description
    Boolean

    InsertStatementService

    Gets the optional service for creating a database insert statement, and a matching delegate for populating the database parameters from a dataflow row. null if not supported by the current provider.

    This service is used by AdbInsertTarget<TInputError>, and you can use it to discover its settings, e.g. the default and maximum number of values per insert batch.

    Declaration
    public IAdbInsertStatementService InsertStatementService { get; }
    Property Value
    Type Description
    IAdbInsertStatementService

    ProviderInvariantName

    Gets the provider invariant name of the underlying ADO.NET database provider, e.g. "Microsoft.Data.SqlClient". Note that this value is not unique, there can be multiple Adb providers (normally with different settings) with the same invariant name.

    Always a non-empty string. Also see Description.

    Declaration
    public string ProviderInvariantName { get; }
    Property Value
    Type Description
    String

    Methods

    CreateCommandBuilder(String)

    Creates a database command builder instance, initialized with a new AdbConnectionBuilder instance. When an AdbCommand is created from the returned builder, it will 'own' the connection. That AdbCommand must be disposed after use, which will also automatically dispose the connection. See Disposing Disposables for details.

    To instead get an AdbCommand with an AdbKeepOpenConnectionBuilder, create the connection builder first (e.g. with CreateKeepOpenConnectionBuilder(String)), and then create command builders from the connection builder.

    Declaration
    public AdbCommandBuilder CreateCommandBuilder(string connectionString)
    Parameters
    Type Name Description
    String connectionString

    The connection string.

    Returns
    Type Description
    AdbCommandBuilder

    Returns an AdbCommandBuilder on success; throws an exception on error.

    Exceptions
    Type Condition
    ArgumentException
    • connectionString - Must supply a non-empty value.

    CreateCommandBuilderFromAppConfig(String)

    Note: .NET Framework only.

    Creates a database command builder instance, using an app.config / web.config connection string to initialize a new AdbConnectionBuilder instance. When an AdbCommand is created from the returned builder, it will 'own' the connection. That AdbCommand must be disposed after use, which will also automatically dispose the connection. See Disposing Disposables for details.

    Note that the providerName setting in the app.config / web.config file is ignored.

    To get an AdbCommand with an AdbKeepOpenConnectionBuilder, instead create the connection builder first (e.g. with CreateKeepOpenConnectionBuilder(String)), and then create command builders from the connection builder.

    Declaration
    public AdbCommandBuilder CreateCommandBuilderFromAppConfig(string connectionStringSettingsName)
    Parameters
    Type Name Description
    String connectionStringSettingsName

    The name of the connection string setting to load from app.config or web.config. See .NET Framework Run-time Settings for more details.

    Returns
    Type Description
    AdbCommandBuilder

    Returns an AdbCommandBuilder on success; throws an exception on error.

    Exceptions
    Type Condition
    ArgumentException
    • Must supply a non-empty connectionString.
    ArgumentNullException

    connectionStringSettingsName

    ConfigurationErrorsException

    connectionStringSettingsName - Could not retrieve a ConnectionStringSettingsCollection object.

    InvalidOperationException
    • connectionStringSettingsName - Could not find connection string setting in app.config/web.config.
    • Connection string in app.config/web.config was empty.
    PlatformNotSupportedException

    app.config files are only supported on .NET Framework.

    CreateCommandBuilderFromDefaultAConfig(String)

    Creates a database command builder instance, using an AConfig connection string (from any DefaultFileNames() files) to initialize a new AdbConnectionBuilder instance. When an AdbCommand is created from the returned builder, it will 'own' the connection. That AdbCommand must be disposed after use, which will also automatically dispose the connection. See Disposing Disposables for details.

    To get an AdbCommand with an AdbKeepOpenConnectionBuilder, instead create the connection builder first (e.g. with CreateKeepOpenConnectionBuilder(String)), and then create command builders from the connection builder.

    Declaration
    public AdbCommandBuilder CreateCommandBuilderFromDefaultAConfig(string connectionStringConfigurationName)
    Parameters
    Type Name Description
    String connectionStringConfigurationName

    The name of the connection string configuration to load from any AConfig default file; see DefaultFileNames() and AConfig Configuration Facility for more details.

    Returns
    Type Description
    AdbCommandBuilder

    Returns an AdbCommandBuilder on success; throws an exception on error.

    Exceptions
    Type Condition
    ArgumentException
    • connectionStringConfigurationName cannot be null or only whitespace.
    • Configuration connectionStringConfigurationName not found.
    • Must supply a non-empty connectionString.
    Exception

    (Various JsonReaderException JSON parsing exceptions.)

    FormatException

    Parse error converting configuration to type T.

    IOException

    An I/O error occurred.

    CreateConnectionBuilder(String)

    Creates an AdbConnectionBuilder instance that in turn can create one AdbConnection database connection.

    Declaration
    public AdbConnectionBuilder CreateConnectionBuilder(string connectionString)
    Parameters
    Type Name Description
    String connectionString

    The connection string.

    Returns
    Type Description
    AdbConnectionBuilder

    Returns an AdbConnectionBuilder on success; throws an exception on error.

    Exceptions
    Type Condition
    ArgumentException

    connectionString - Must supply a non-empty value.

    CreateConnectionBuilderFromAppConfig(String)

    Note: .NET Framework only.

    Creates an AdbConnectionBuilder instance that in turn can create one AdbConnection database connection.

    Note that the providerName setting in the app.config / web.config file is ignored.

    Declaration
    public AdbConnectionBuilder CreateConnectionBuilderFromAppConfig(string connectionStringSettingsName)
    Parameters
    Type Name Description
    String connectionStringSettingsName

    The name of the connection string setting to load from app.config or web.config. See .NET Framework Run-time Settings for more details.

    Returns
    Type Description
    AdbConnectionBuilder

    Returns an AdbConnectionBuilder on success; throws an exception on error.

    Exceptions
    Type Condition
    ArgumentException
    • Must supply a non-empty providerName and connectionString.
    ArgumentNullException

    connectionStringSettingsName

    ConfigurationErrorsException

    connectionStringSettingsName - Could not retrieve a ConnectionStringSettingsCollection object.

    InvalidOperationException
    • connectionStringSettingsName - Could not find connection string setting in app.config/web.config.
    • Connection string in app.config/web.config was empty.
    PlatformNotSupportedException

    app.config files are only supported on .NET Framework.

    CreateConnectionBuilderFromDefaultAConfig(String)

    Creates an AdbConnectionBuilder instance using an AConfig connection string (from any DefaultFileNames() files), that in turn can create one AdbConnection database connection.

    Declaration
    public AdbConnectionBuilder CreateConnectionBuilderFromDefaultAConfig(string connectionStringConfigurationName)
    Parameters
    Type Name Description
    String connectionStringConfigurationName

    The name of the connection string configuration to load from any AConfig default file; see DefaultFileNames() and AConfig Configuration Facility for more details.

    Returns
    Type Description
    AdbConnectionBuilder

    Returns an AdbConnectionBuilder on success; throws an exception on error.

    Exceptions
    Type Condition
    ArgumentException
    • connectionStringConfigurationName cannot be null or only whitespace.
    • Configuration connectionStringConfigurationName not found.
    • Must supply a non-empty connectionString.
    Exception

    (Various JsonReaderException JSON parsing exceptions.)

    FormatException

    Parse error converting configuration to type T.

    IOException

    An I/O error occurred.

    CreateConnectionString(String)

    Creates an AdbConnectionString factory instance, which in turn can create AdbConnectionBuilder and AdbKeepOpenConnectionBuilder instances.

    Declaration
    public AdbConnectionString CreateConnectionString(string connectionString)
    Parameters
    Type Name Description
    String connectionString

    The connection string.

    Returns
    Type Description
    AdbConnectionString

    Returns the connection string factory instance on success; throws an exception on error.

    Exceptions
    Type Condition
    ArgumentException

    connectionString - Must supply a non-empty value.

    CreateConnectionStringFromAppConfig(String)

    Note: .NET Framework only.

    Returns a (text) connection string from the app.config / web.config file.

    Note that the providerName setting in the app.config / web.config file is ignored.

    Declaration
    public AdbConnectionString CreateConnectionStringFromAppConfig(string connectionStringSettingsName)
    Parameters
    Type Name Description
    String connectionStringSettingsName

    The name of the connection string setting to load from app.config or web.config. See .NET Framework Run-time Settings for more details.

    Returns
    Type Description
    AdbConnectionString

    Returns an AdbConnectionString on success; throws an exception on error.

    Exceptions
    Type Condition
    ArgumentException
    • Must supply a non-empty providerName and connectionString.
    ConfigurationErrorsException

    connectionStringSettingsName - Could not retrieve a ConnectionStringSettingsCollection object.

    InvalidOperationException
    • connectionStringSettingsName - Could not find connection string setting in app.config/web.config.
    • Connection string in app.config/web.config was empty.
    PlatformNotSupportedException

    app.config files are only supported on .NET Framework.

    CreateConnectionStringFromDefaultAConfig(String)

    Returns a (text) AConfig connection string from any DefaultFileNames() files.

    Declaration
    public AdbConnectionString CreateConnectionStringFromDefaultAConfig(string connectionStringConfigurationName)
    Parameters
    Type Name Description
    String connectionStringConfigurationName

    The name of the connection string configuration to load from any AConfig default file; see DefaultFileNames() and AConfig Configuration Facility for more details.

    Returns
    Type Description
    AdbConnectionString

    Returns an AdbConnectionString on success; throws an exception on error.

    Exceptions
    Type Condition
    ArgumentException
    • connectionStringConfigurationName cannot be null or only whitespace.
    • Configuration connectionStringConfigurationName not found.
    • Must supply a non-empty connectionString.
    Exception

    (Various JsonReaderException JSON parsing exceptions.)

    FormatException

    Parse error converting configuration to type T.

    IOException

    An I/O error occurred.

    CreateKeepOpenConnectionBuilder(String)

    Creates an AdbKeepOpenConnectionBuilder instance that must be disposed after the associated connection is no longer used. Only when this instance is disposed will the underlying .NET connection be closed and disposed.

    The builder instance is in turn used to create a single AdbKeepOpenConnection database connection, which must also be explicitly disposed when it is no longer used.

    Disposal should almost always be done by whoever created the connection, typically via DisposeOnFinished<TDisposable>(TDisposable) or UsingActionWorker<TDisposable> if used across multiple method calls, or by a using statement if created and disposed in a single method and thread, without being passed to any other workers. See Disposing Disposables for details.

    Declaration
    public AdbKeepOpenConnectionBuilder CreateKeepOpenConnectionBuilder(string connectionString)
    Parameters
    Type Name Description
    String connectionString

    The connection string.

    Returns
    Type Description
    AdbKeepOpenConnectionBuilder

    Returns an AdbKeepOpenConnectionBuilder instance on success; throws an exception on error.

    Exceptions
    Type Condition
    ArgumentException

    connectionString - Must supply a non-empty value.

    CreateKeepOpenConnectionBuilderFromAppConfig(String)

    Note: .NET Framework only.

    Creates an AdbKeepOpenConnectionBuilder instance that must be disposed after the associated connection is no longer used. Only when this instance is disposed will the underlying .NET connection be closed and disposed.

    The builder instance is in turn used to create a single AdbKeepOpenConnection database connection, which must also be explicitly disposed when it is no longer used.

    Disposal should almost always be done by whoever created the instance, typically by using DisposeOnFinished<TDisposable>(TDisposable) or UsingActionWorker<TDisposable> if passed to other workers or used across multiple method calls, or by a using statement if created and disposed in a single method and thread, without being passed to any other workers. See Disposing Disposables for details.

    Note that the providerName setting in the app.config / web.config file is ignored.

    Declaration
    public AdbKeepOpenConnectionBuilder CreateKeepOpenConnectionBuilderFromAppConfig(string connectionStringSettingsName)
    Parameters
    Type Name Description
    String connectionStringSettingsName

    The name of the connection string setting to load from app.config or web.config. See .NET Framework Run-time Settings for more details.

    Returns
    Type Description
    AdbKeepOpenConnectionBuilder

    Returns an AdbKeepOpenConnectionBuilder instance on success; throws an exception on error.

    Exceptions
    Type Condition
    ArgumentException
    • Must supply a non-empty providerName and connectionString.
    ArgumentNullException

    connectionStringSettingsName

    ConfigurationErrorsException

    connectionStringSettingsName - Could not retrieve a ConnectionStringSettingsCollection object.

    InvalidOperationException
    • connectionStringSettingsName - Could not find connection string setting in app.config/web.config.
    • Connection string in app.config/web.config was empty.
    PlatformNotSupportedException

    app.config files are only supported on .NET Framework.

    CreateKeepOpenConnectionBuilderFromDefaultAConfig(String)

    Creates an AdbKeepOpenConnectionBuilder instance (using an AConfig connection string (from any DefaultFileNames() files) that must be disposed after the associated connection is no longer used. Only when this instance is disposed will the underlying .NET connection be closed and disposed.

    The builder instance is in turn used to create a single AdbKeepOpenConnection database connection, which must also be explicitly disposed when it is no longer used.

    Disposal should almost always be done by whoever created the instance, typically by using DisposeOnFinished<TDisposable>(TDisposable) or UsingActionWorker<TDisposable> if passed to other workers or used across multiple method calls, or by a using statement if created and disposed in a single method and thread, without being passed to any other workers. See Disposing Disposables for details.

    Declaration
    public AdbKeepOpenConnectionBuilder CreateKeepOpenConnectionBuilderFromDefaultAConfig(string connectionStringConfigurationName)
    Parameters
    Type Name Description
    String connectionStringConfigurationName

    The name of the connection string configuration to load from any AConfig default file; see DefaultFileNames() and AConfig Configuration Facility for more details.

    Returns
    Type Description
    AdbKeepOpenConnectionBuilder

    Returns an AdbKeepOpenConnectionBuilder instance on success; throws an exception on error.

    Exceptions
    Type Condition
    ArgumentException
    • connectionStringConfigurationName cannot be null or only whitespace.
    • Configuration connectionStringConfigurationName not found.
    • Must supply a non-empty connectionString.
    Exception

    (Various JsonReaderException JSON parsing exceptions.)

    FormatException

    Parse error converting configuration to type T.

    IOException

    An I/O error occurred.

    ToString()

    Returns the provider Description.

    Declaration
    public override string ToString()
    Returns
    Type Description
    String
    Overrides
    Object.ToString()

    WithDataSourceInformation(String, Func<IAdbConnection, IAdbDataSourceInformationService>)

    Creates a new provider instance with all the same services, except with the actionETL.Adb.AdbProvider.DataSourceInformationServiceFunc replaced with the provided one.

    Declaration
    public AdbProvider WithDataSourceInformation(string description, Func<IAdbConnection, IAdbDataSourceInformationService> dataSourceInformationServiceFunc)
    Parameters
    Type Name Description
    String description

    A description of the Adb provider, or an empty string, or null to retain the same description. This is used mainly for informational purposes in logging etc. As a convention, this is a colon separated concatenation of ProviderInvariantName, the supported data source product(s), and any non-default settings. Separate multiple settings with underscore, in alphabetical order, and use equal sign to specify any values, e.g.:

    "Microsoft.Data.SqlClient:SQL Server:AnsiQuotes", "System.Data.Odbc:ODBC without TableInformation:", "System.Data.Odbc:SqlServer2005:", "System.Data.Odbc:PostgreSQL:AnsiQuotes_LongTimeout=120" etc.

    Func<IAdbConnection, IAdbDataSourceInformationService> dataSourceInformationServiceFunc

    A callback that returns a new (usually provider-specific) data source information service instance.

    Returns
    Type Description
    AdbProvider

    The provider instance itself, so that multiple calls can be chained together.

    Exceptions
    Type Condition
    ArgumentException

    description - Must supply a non-empty value

    WithInsertStatementService(String, IAdbInsertStatementService)

    Creates a new provider instance with all the same services, except with the (optional) IAdbInsertStatementService replaced with the provided one, e.g. an AdbSql92InsertStatementService instance.

    Declaration
    public AdbProvider WithInsertStatementService(string description, IAdbInsertStatementService insertStatementService)
    Parameters
    Type Name Description
    String description

    A description of the Adb provider, or an empty string, or null to retain the same description. This is used mainly for informational purposes in logging etc. As a convention, this is a colon separated concatenation of ProviderInvariantName, the supported data source product(s), and any non-default settings. Separate multiple settings with underscore, in alphabetical order, and use equal sign to specify any values, e.g.:

    "Microsoft.Data.SqlClient:SQL Server:AnsiQuotes", "System.Data.Odbc:ODBC without TableInformation:", "System.Data.Odbc:SqlServer2005:", "System.Data.Odbc:PostgreSQL:AnsiQuotes_LongTimeout=120" etc.

    IAdbInsertStatementService insertStatementService

    The optional insert statement service, or null to not provide this service.

    Returns
    Type Description
    AdbProvider

    The provider instance itself, so that multiple calls can be chained together.

    Exceptions
    Type Condition
    ArgumentException

    description - Must supply a non-empty value

    See Also
    WithSql92InsertStatement(Int32, Int32, Int64)

    WithSql92InsertStatement(Int32, Int32, Int64)

    Creates a new provider instance with all the same services, except with the (optional) IAdbInsertStatementService replaced with the specified AdbSql92InsertStatementService one.

    Declaration
    public AdbProvider WithSql92InsertStatement(int defaultValuesPerBatch, int maxValuesPerBatch, long defaultValuesPerTransaction)
    Parameters
    Type Name Description
    Int32 defaultValuesPerBatch

    The default number of values (or parameters) per insert batch (or multi-row statement), which determines the default number of rows per batch.

    When set to 0 or less, the default number of parameters per batch is used (currently 256). When set to 1 or greater (e.g. 500), the number of rows is calculated by dividing by the number of values (or parameters) that is processed per row, and using no less than 1 row per batch.

    Inserting multiple rows per batch typically increases performance, although using too many parameters can decrease performance, and increases database resource usage.

    Note that with multiple rows per batch, any insert error will reject all the rows in the batch.

    Int32 maxValuesPerBatch

    The maximum number of values (or parameters) allowed per batch or multi-row insert statement, e.g. 999. It sets a hard limit on how large an individual worker can set valuesPerBatch with SetRowLimits(Int32, Int64).

    This is used to calculate the maximum number of rows per batch by dividing by the number of values (or parameters) that is processed per row, and using no less than one row per batch.

    Note that for some databases, performance degrades when using too many parameters in a batch.

    Int64 defaultValuesPerTransaction

    The default number of values (or parameters) to use per explicit transaction. This is used to calculate the default number of rows per explicit transaction.

    When set to 1 or greater (e.g. 50000), the number of rows is calculated by dividing by the number of values (or parameters) that is processed per row, and using no less than 1 row per explicit transaction. This means that when set to a very large value (e.g. long.MaxValue), all rows should be inserted wrapped in a single explicit transaction.

    When set to 0, the default number of values (currently 16384) is used.

    When set to less than 0, an explicit transaction should not be created.

    Note that if the connection already has an active transaction, the insert worker should participate in it, irrespective of what this setting is set to.

    Wrapping many insert statements in a transaction typically increases performance, although using too many values per transaction can decrease performance, and increases database resource usage. Wrapping just one or a few insert statements in a transaction is possible, but typically also decreases performance.

    Note that with multiple rows in the transaction, any insert error will reject all the rows in the transaction.

    Returns
    Type Description
    AdbProvider
    See Also
    WithInsertStatementService(String, IAdbInsertStatementService)

    WithTableCommandService(String, Func<IAdbConnection, IAdbTableCommandService>)

    Creates a new provider instance with all the same services, except with the actionETL.Adb.AdbProvider.TableCommandServiceFunc replaced with the provided one.

    Declaration
    public AdbProvider WithTableCommandService(string description, Func<IAdbConnection, IAdbTableCommandService> tableCommandServiceFunc)
    Parameters
    Type Name Description
    String description

    A description of the Adb provider, or an empty string, or null to retain the same description. This is used mainly for informational purposes in logging etc. As a convention, this is a colon separated concatenation of ProviderInvariantName, the supported data source product(s), and any non-default settings. Separate multiple settings with underscore, in alphabetical order, and use equal sign to specify any values, e.g.:

    "Microsoft.Data.SqlClient:SQL Server:AnsiQuotes", "System.Data.Odbc:ODBC without TableInformation:", "System.Data.Odbc:SqlServer2005:", "System.Data.Odbc:PostgreSQL:AnsiQuotes_LongTimeout=120" etc.

    Func<IAdbConnection, IAdbTableCommandService> tableCommandServiceFunc

    A (usually provider-specific) table information service, or null to not provide this service.

    Returns
    Type Description
    AdbProvider

    The provider instance itself, so that multiple calls can be chained together.

    Exceptions
    Type Condition
    ArgumentException

    description - Must supply a non-empty value

    WithTableInformationService(String, Func<IAdbConnection, IAdbTableInformationService>)

    Creates a new provider instance with all the same services, except with the actionETL.Adb.AdbProvider.TableInformationServiceFunc replaced with the provided one.

    Declaration
    public AdbProvider WithTableInformationService(string description, Func<IAdbConnection, IAdbTableInformationService> tableInformationServiceFunc)
    Parameters
    Type Name Description
    String description

    A description of the Adb provider, or an empty string, or null to retain the same description. This is used mainly for informational purposes in logging etc. As a convention, this is a colon separated concatenation of ProviderInvariantName, the supported data source product(s), and any non-default settings. Separate multiple settings with underscore, in alphabetical order, and use equal sign to specify any values, e.g.:

    "Microsoft.Data.SqlClient:SQL Server:AnsiQuotes", "System.Data.Odbc:ODBC without TableInformation:", "System.Data.Odbc:SqlServer2005:", "System.Data.Odbc:PostgreSQL:AnsiQuotes_LongTimeout=120" etc.

    Func<IAdbConnection, IAdbTableInformationService> tableInformationServiceFunc

    A (usually provider-specific) table information service, or null to not provide this service.

    Returns
    Type Description
    AdbProvider

    The provider instance itself, so that multiple calls can be chained together.

    Exceptions
    Type Condition
    ArgumentException

    description - Must supply a non-empty value

    WithTypeMapper(String, IAdbTypeMapper)

    Creates a new provider instance with all the same services, except with the actionETL.Adb.AdbProvider.TypeMapper replaced with the provided one.

    Declaration
    public AdbProvider WithTypeMapper(string description, IAdbTypeMapper typeMapper)
    Parameters
    Type Name Description
    String description

    A description of the Adb provider, or an empty string, or null to retain the same description. This is used mainly for informational purposes in logging etc. As a convention, this is a colon separated concatenation of ProviderInvariantName, the supported data source product(s), and any non-default settings. Separate multiple settings with underscore, in alphabetical order, and use equal sign to specify any values, e.g.:

    "Microsoft.Data.SqlClient:SQL Server:AnsiQuotes", "System.Data.Odbc:ODBC without TableInformation:", "System.Data.Odbc:SqlServer2005:", "System.Data.Odbc:PostgreSQL:AnsiQuotes_LongTimeout=120" etc.

    IAdbTypeMapper typeMapper

    A (usually provider-specific) database type mapper.

    Returns
    Type Description
    AdbProvider

    The provider instance itself, so that multiple calls can be chained together.

    Exceptions
    Type Condition
    ArgumentException

    description - Must supply a non-empty value

    WithTypeService(String, IAdbTypeService)

    Creates a new provider instance with all the same services, except with the actionETL.Adb.AdbProvider.TypeService replaced with the provided one.

    Declaration
    public AdbProvider WithTypeService(string description, IAdbTypeService typeService)
    Parameters
    Type Name Description
    String description

    A description of the Adb provider, or an empty string, or null to retain the same description. This is used mainly for informational purposes in logging etc. As a convention, this is a colon separated concatenation of ProviderInvariantName, the supported data source product(s), and any non-default settings. Separate multiple settings with underscore, in alphabetical order, and use equal sign to specify any values, e.g.:

    "Microsoft.Data.SqlClient:SQL Server:AnsiQuotes", "System.Data.Odbc:ODBC without TableInformation:", "System.Data.Odbc:SqlServer2005:", "System.Data.Odbc:PostgreSQL:AnsiQuotes_LongTimeout=120" etc.

    IAdbTypeService typeService

    A (usually provider-specific) database type service.

    Returns
    Type Description
    AdbProvider

    The provider instance itself, so that multiple calls can be chained together.

    Exceptions
    Type Condition
    ArgumentException

    description - Must supply a non-empty value

    See Also

    AdbConnectionString
    AdbConnectionBuilder
    AdbKeepOpenConnectionBuilder
    AdbCommandBuilder
    IAdbDataSourceInformationService
    IAdbInsertStatementService
    IAdbTableCommandService
    IAdbTableInformationService
    IAdbTypeMapper
    IAdbTypeService
    In This Article
    Back to top Copyright © 2021 Envobi Ltd