Namespace actionETL.Adb.NpgsqlExternal
Contains the Adb database provider and supporting services for PostgreSQL® and its
Npgsql
.NET database provider.
Classes
AdbNpgsqlDataSourceInformationService
Provides information about a PostgreSQL® 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 Get() to retrieve the required delegate.
This class can be inherited to overwrite some values, and used to create a custom Npgsql
provider,
see AdbNpgsqlProvider and Information for more 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.
AdbNpgsqlProvider
A static class where the Get() overloads return AdbProvider immutable instances that wrap the Npgsql ADO.NET database provider for accessing PostgreSQL® databases, 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 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.
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:
AdbNpgsqlTableCommandService
For a PostgreSQL® 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, AdbNpgsqlTableInformationService, AdbNpgsqlDataSourceInformationService, AdbConnection and AdbProvider.
AdbNpgsqlTableInformationService
An optional service for a PostgreSQL® 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, AdbNpgsqlTableCommandService, AdbNpgsqlDataSourceInformationService, 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.
AdbNpgsqlTypeMapper
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 PostgreSQL® 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.
AdbNpgsqlTypeService
Gets and sets types and values on database parameters for a Npgsql
provider, such as AdbNpgsqlProvider, for a PostgreSQL® data source.
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.