Class AdbDataSourceInformation
A class that provides and helps process the information about a 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. Each Adb provider supplies this information by implementing IAdbDataSourceInformationService.
Also see Information, TableInformation and AdbProvider.
Namespace: actionETL.Adb
Assembly: actionETL.dll
Syntax
public class AdbDataSourceInformation
Properties
CompositeIdentifierSeparator
Gets the primary composite identifier separator, that e.g. separates the table name from the schema name.
Note that some providers use a different character when including e.g. the database name. Therefore always use the methods in AdbTableInformation to manipulate table identifiers, such as ComposeTableIdentifierParts(String, String, String) and CreateTableIdentifier(String).
Declaration
public string CompositeIdentifierSeparator { get; }
Property Value
| Type | Description |
|---|---|
| String |
CompositeIdentifierSeparatorPattern
Gets the composite identifier separator regular expression pattern.
Declaration
public string CompositeIdentifierSeparatorPattern { get; }
Property Value
| Type | Description |
|---|---|
| String |
DataSourceProductName
Gets the name of the data source product.
Declaration
public string DataSourceProductName { get; }
Property Value
| Type | Description |
|---|---|
| String |
DataSourceProductVersion
Gets the data source product version.
Declaration
public string DataSourceProductVersion { get; }
Property Value
| Type | Description |
|---|---|
| String |
DataSourceProductVersionNormalized
Gets the normalized data source product version, which is easier
(vs. DataSourceProductVersion) to compare to find out which version is greater.
Declaration
public string DataSourceProductVersionNormalized { get; }
Property Value
| Type | Description |
|---|---|
| String |
GroupByBehavior
Gets the relationship between the columns in a GROUP BY clause and the non-aggregated columns in the select-list of a SELECT statement.
Declaration
public GroupByBehavior GroupByBehavior { get; }
Property Value
| Type | Description |
|---|---|
| GroupByBehavior |
IdentifierCase
Gets how identifiers are treated by the data source when searching the system catalog.
Declaration
public IdentifierCase IdentifierCase { get; }
Property Value
| Type | Description |
|---|---|
| IdentifierCase |
IdentifierPattern
Gets the regular expression pattern that matches an unquoted (non-composite) identifier and has a match value of the identifier, or the empty string if not available.
Declaration
public string IdentifierPattern { get; }
Property Value
| Type | Description |
|---|---|
| String | For example |
IdentifierQuotePrefix
Gets the identifier quote prefix, i.e. the quote string used on the left side of an identifier part.
Declaration
public string IdentifierQuotePrefix { get; }
Property Value
| Type | Description |
|---|---|
| String |
IdentifierQuotePrefixes
Gets the identifier quote prefixes, i.e. all possible quote characters used on the left side of an identifier part.
Declaration
public string IdentifierQuotePrefixes { get; }
Property Value
| Type | Description |
|---|---|
| String |
IdentifierQuoteSuffix
Gets the identifier quote suffix, i.e. the quote string used on the right side of an identifier part.
Declaration
public string IdentifierQuoteSuffix { get; }
Property Value
| Type | Description |
|---|---|
| String |
IdentifierQuoteSuffixes
Gets the identifier quote suffixes, i.e. all possible quote characters used on the right side of an identifier part.
Declaration
public string IdentifierQuoteSuffixes { get; }
Property Value
| Type | Description |
|---|---|
| String |
OrderByColumnsInSelect
Gets whether columns in an ORDER BY clause must be in the select list.
Declaration
public bool OrderByColumnsInSelect { get; }
Property Value
| Type | Description |
|---|---|
| Boolean |
|
ParameterMarkerFormat
Gets a format string that can be used to format a parameter.
If named parameters are not supported, and the provider expects the use of the ?
character, the format string should be ?, which would ignore the parameter name.
Declaration
public string ParameterMarkerFormat { get; }
Property Value
| Type | Description |
|---|---|
| String | For example |
ParameterMarkerPattern
Gets a regular expression pattern that matches a parameter marker, and with a match value of the parameter name, if any.
Declaration
public string ParameterMarkerPattern { get; }
Property Value
| Type | Description |
|---|---|
| String | The regular expression parameter marker pattern.
For example, if named parameters are supported with an
If named parameters instead are supported with a ?.
|
ParameterNameMaxLength
Gets the maximum length in characters of the parameter name, or 0 if parameter
names are not supported.
Declaration
public int ParameterNameMaxLength { get; }
Property Value
| Type | Description |
|---|---|
| Int32 |
ParameterNamePattern
Gets the regular expression pattern that matches valid parameter names.
Declaration
public string ParameterNamePattern { get; }
Property Value
| Type | Description |
|---|---|
| String |
QuotedIdentifierCase
Gets whether quoted identifiers are treated as case sensitive or not.
Declaration
public IdentifierCase QuotedIdentifierCase { get; }
Property Value
| Type | Description |
|---|---|
| IdentifierCase |
QuotedIdentifierPattern
Gets a regular expression that matches a quoted (non-composite) identifier and has a match value of the identifier itself without the quotes.
Declaration
public string QuotedIdentifierPattern { get; }
Property Value
| Type | Description |
|---|---|
| String | The quoted identifier regular expression pattern.
For example, if the data source uses double-quotes to identify quoted identifiers,
this would be: |
StatementSeparatorPattern
Gets a regular expression pattern that matches the statement separator.
Declaration
public string StatementSeparatorPattern { get; }
Property Value
| Type | Description |
|---|---|
| String |
StringLiteralPattern
Gets a regular expression pattern that matches a string literal, and has a match value of the literal itself.
Declaration
public string StringLiteralPattern { get; }
Property Value
| Type | Description |
|---|---|
| String | For example, if the data source uses single-quotes to identify strings, this
would be: |
SupportedJoinOperators
Gets the supported join operators.
Declaration
public SupportedJoinOperators SupportedJoinOperators { get; }
Property Value
| Type | Description |
|---|---|
| SupportedJoinOperators |
UsesPositionalParameters
Returns true if the provider uses positional parameters;
returns false if the provider uses named parameters.
Also see GetPlaceholder(String) and
StripParameterMarker(String).
Declaration
public bool UsesPositionalParameters { get; }
Property Value
| Type | Description |
|---|---|
| Boolean |
Methods
CreateSetParametersFromRowAction<T>(AdbParameterCollection)
Creates an action that sets database query parameters from a dataflow row. This avoids
having to set each parameter manually, and also handles null values correctly
for both reference types and Nullable{T} types, assigning DBNull where
needed. The action has a signature corresponding to:
void SetParametersFromRow(T row)
The action is created using a compiled expression tree to achieve high performance. The most common scenario is to store the action in a class field or local variable, and run it for all rows from a dataflow input port.
Declaration
public Action<T> CreateSetParametersFromRowAction<T>(AdbParameterCollection parameters)
Parameters
| Type | Name | Description |
|---|---|---|
| AdbParameterCollection | parameters | The database parameters whose values will be set from a dataflow row. Parameters and row columns are matched by name, and all parameters must be matched, or an exception will be thrown. By default, they will be matched on ParameterName, although this can be overridden by setting SourceColumn to the dataflow row column name. Column name matching is ordinal case insensitive, but a case sensitive match takes precedence over a case insensitive match. |
Returns
| Type | Description |
|---|---|
| Action<T> | The action, which takes the following parameter:
|
Type Parameters
| Name | Description |
|---|---|
| T | The type of the dataflow row. Must be a class. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | The row type must be a class, not a value type or interface. |
| ArgumentNullException |
|
| InvalidOperationException | Parameter name (or SourceColumn) not found in row column names. |
GetPlaceholder(String)
Returns the parameter placeholder string, for creating SQL queries. Also see StripParameterMarker(String) and UsesPositionalParameters.
Declaration
public string GetPlaceholder(string parameterName)
Parameters
| Type | Name | Description |
|---|---|---|
| String | parameterName | The parameter name, with or without a parameter marker. |
Returns
| Type | Description |
|---|---|
| String | The parameter placeholder, e.g. |
QuoteIdentifierPart(String)
Quotes the table or column identifier part, i.e. column name, table name, schema/owner name, or database/catalog name. Does not quote it if it's already quoted with IdentifierQuotePrefix and IdentifierQuoteSuffix.
Declaration
public string QuoteIdentifierPart(string unquotedIdentifierPart)
Parameters
| Type | Name | Description |
|---|---|---|
| String | unquotedIdentifierPart | The potentially unquoted identifier part. |
Returns
| Type | Description |
|---|---|
| String | The quoted identifier part. |
StripParameterMarker(String)
Returns the specified parameter name with a parameter marker removed (e.g.
@ or :, if present), if the provider uses named parameters.
Otherwise the parameter name is returned unchanged.
Also see GetPlaceholder(String) and
UsesPositionalParameters.
Declaration
public string StripParameterMarker(string parameterName)
Parameters
| Type | Name | Description |
|---|---|---|
| String | parameterName | The parameter name, with or without a parameter marker. |
Returns
| Type | Description |
|---|---|
| String | The parameter name, with any parameter marker removed. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | parameterName |
ToString()
Returns a string that represents this instance.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| String |