Class 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.
Implements
Inherited Members
Namespace: actionETL.Adb.NpgsqlExternal
Assembly: actionETL.dll
Syntax
public class AdbNpgsqlTableInformationService : AdbGenericTableInformationService, IAdbTableInformationService
Methods
Get()
Gets a function that returns a new instance of AdbNpgsqlTableInformationService on each invocation, which is used when instantiating a new AdbProvider for accessing a PostgreSQL® data source.
Declaration
public static Func<IAdbConnection, IAdbTableInformationService> Get()
Returns
| Type | Description |
|---|---|
| Func<IAdbConnection, IAdbTableInformationService> |
GetTableColumnsAsync(IAdbTableIdentifier)
Gets information (name, data type etc.) about all columns in a table-like database object.
With a PostgreSQL® data source the following are supported by this method, and by workers using this method: tables (user, system, temporary, and partitioned) and views (user, system, and materialized).
Note that this method does not log errors. Instead the caller should normally log any returned failure status.
Declaration
public override async Task<OutcomeStatusResult<IList<AdbColumnSchema>>> GetTableColumnsAsync(IAdbTableIdentifier tableIdentifier)
Parameters
| Type | Name | Description |
|---|---|---|
| IAdbTableIdentifier | tableIdentifier | The identifier for a table-like object to check. It must specify table name,
but schema and/or catalog names can be |
Returns
| Type | Description |
|---|---|
| Task<OutcomeStatusResult<IList<AdbColumnSchema>>> | On success, Status will be
On failure, Status will have a
failure status, and Result will be
An incorrect parameter will throw immediately. Any other exceptions or failures
will be caught and contained in the returned See the provider documentation for specific Open() exceptions. Some providers may throw if the connection is associated with a transaction. |
Overrides
Exceptions
| Type | Condition |
|---|---|
| ArgumentException |
|
| ArgumentNullException |
|
GetTableTypeAsync(IAdbTableIdentifier)
Check if a table-like object exists, and what type (table, view, etc.) it is.
With a PostgreSQL® data source the following are supported by this method, and by workers using this method: tables (user, system, temporary, and partitioned) and views (user, system, and materialized).
Note that this method does not log errors. Instead the caller should normally log any returned failure status.
Declaration
public override async Task<OutcomeStatusResult<AdbTableType>> GetTableTypeAsync(IAdbTableIdentifier tableIdentifier)
Parameters
| Type | Name | Description |
|---|---|---|
| IAdbTableIdentifier | tableIdentifier | The identifier for a table-like object to check. It must specify table name,
but schema and/or catalog names can be |
Returns
| Type | Description |
|---|---|
| Task<OutcomeStatusResult<AdbTableType>> | On success, Status will be
On failure, Status will have a failure status, and Result will be undefined.
An incorrect parameter will throw immediately. Any other exceptions or failures
will be caught and contained in the returned See the provider documentation for specific Open() exceptions. Some providers may throw if the connection is associated with a transaction. |
Overrides
Exceptions
| Type | Condition |
|---|---|
| ArgumentException |
|
| ArgumentNullException |
|