Class PostgreSqlExecutor
Provides methods for queries execution.
Inheritance
System.Object
PostgreSqlExecutor
Implements
System.IDisposable
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Assembly: Terrasoft.DB.PostgreSql.dll
Syntax
public class PostgreSqlExecutor : DBExecutor, IDisposable, INonMarsDbExecutor
Constructors
PostgreSqlExecutor(UserConnection)
Declaration
public PostgreSqlExecutor(UserConnection userConnection)
Parameters
PostgreSqlExecutor(UserConnection, QueryKind)
Declaration
public PostgreSqlExecutor(UserConnection userConnection, QueryKind queryKind)
Parameters
Type |
Name |
Description |
UserConnection |
userConnection |
|
QueryKind |
queryKind |
|
Properties
CurrentOpenedReader
Declaration
public IBufferingDataReader CurrentOpenedReader { get; set; }
Property Value
IsOffsetPagingFeatureEnabled
Declaration
protected override bool IsOffsetPagingFeatureEnabled { get; }
Property Value
Type |
Description |
System.Boolean |
|
Overrides
UseDaylightSavingTimeSupport
Declaration
protected override bool UseDaylightSavingTimeSupport { get; }
Property Value
Type |
Description |
System.Boolean |
|
Overrides
Methods
AddQueryParameterToSqlParameters(NpgsqlParameterCollection, QueryParameter)
Declaration
protected void AddQueryParameterToSqlParameters(NpgsqlParameterCollection parameters, QueryParameter queryParameter)
Parameters
Type |
Name |
Description |
NpgsqlParameterCollection |
parameters |
|
QueryParameter |
queryParameter |
|
BuildConnectionString(String, String)
Declaration
protected override string BuildConnectionString(string userName, string password)
Parameters
Type |
Name |
Description |
System.String |
userName |
|
System.String |
password |
|
Returns
Type |
Description |
System.String |
|
Overrides
DBParametersToQueryParameters(DbParameterCollection, QueryParameterCollection)
Declaration
protected override void DBParametersToQueryParameters(DbParameterCollection dbParameters, QueryParameterCollection queryParameters)
Parameters
Overrides
InitilizeConnectionAfterOpen(DbConnection)
Declaration
protected override void InitilizeConnectionAfterOpen(DbConnection dbConnection)
Parameters
Type |
Name |
Description |
System.Data.Common.DbConnection |
dbConnection |
|
Overrides
InternalExecute(String, QueryParameterCollection)
Executes a SQL statement with parameters, if any, against a connection object.
Declaration
protected override int InternalExecute(string sqlText, QueryParameterCollection queryParameters)
Parameters
Type |
Name |
Description |
System.String |
sqlText |
SQL command text.
|
QueryParameterCollection |
queryParameters |
Query parameters that will be converted into
System.Data.Common.DbParameterCollection
|
Returns
Type |
Description |
System.Int32 |
The number of rows affected.
|
Overrides
Exceptions
InternalExecuteAsync(String, QueryParameterCollection)
An asynchronous version of InternalExecute, which executes a SQL statement with parameters, if any,
against a connection object.
Declaration
protected override async Task<int> InternalExecuteAsync(string sqlText, QueryParameterCollection queryParameters)
Parameters
Type |
Name |
Description |
System.String |
sqlText |
SQL command text.
|
QueryParameterCollection |
queryParameters |
Query parameters that will be converted into
System.Data.Common.DbParameterCollection
|
Returns
Type |
Description |
System.Threading.Tasks.Task<System.Int32> |
The number of rows affected.
|
Overrides
InternalExecuteReader(String, QueryParameterCollection, CommandBehavior, CancellationToken)
Sends SQL command text and its parameters to the connection, and builds a DataReader
using one of the CommandBehavior values.
Command execution can be cancelled with the token.
Declaration
protected override IDataReader InternalExecuteReader(string sqlText, QueryParameterCollection queryParameters, CommandBehavior behavior, CancellationToken cancellationToken)
Parameters
Type |
Name |
Description |
System.String |
sqlText |
SQL command text.
|
QueryParameterCollection |
queryParameters |
Query parameters that will be converted into
System.Data.Common.DbParameterCollection.
|
System.Data.CommandBehavior |
behavior |
Provides a description of the results of the query
and its effect on the database.
|
System.Threading.CancellationToken |
cancellationToken |
The token to monitor for cancellation requests.
|
Returns
Type |
Description |
System.Data.IDataReader |
Instance implementing System.Data.IDataReader
for the resulting set of records.
|
Overrides
Exceptions
InternalExecuteReaderAsync(String, QueryParameterCollection, CommandBehavior, CancellationToken)
An asynchronous version of InternalExecuteReader, which sends SQL command text and its parameters to the
connection, and builds a DataReader using one of the CommandBehavior values.
Command execution can be cancelled with the token.
Declaration
protected override async Task<IDataReader> InternalExecuteReaderAsync(string sqlText, QueryParameterCollection queryParameters, CommandBehavior behavior, CancellationToken cancellationToken)
Parameters
Type |
Name |
Description |
System.String |
sqlText |
SQL command text.
|
QueryParameterCollection |
queryParameters |
Query parameters that will be converted into
System.Data.Common.DbParameterCollection.
|
System.Data.CommandBehavior |
behavior |
Provides a description of the results of the query
and its effect on the database.
|
System.Threading.CancellationToken |
cancellationToken |
The token to monitor for cancellation requests.
|
Returns
Type |
Description |
System.Threading.Tasks.Task<System.Data.IDataReader> |
Instance implementing System.Data.IDataReader
for the resulting set of records.
|
Overrides
InternalExecuteScalar<TResult>(String, QueryParameterCollection)
Executes a SQL statement with parameters, and returns the first column of the first row
in the result set returned by the query. Additional columns or rows are ignored.
Declaration
protected override TResult InternalExecuteScalar<TResult>(string sqlText, QueryParameterCollection queryParameters)
Parameters
Type |
Name |
Description |
System.String |
sqlText |
SQL command text.
|
QueryParameterCollection |
queryParameters |
Query parameters that will be converted into
System.Data.Common.DbParameterCollection.
|
Returns
Type |
Description |
TResult |
Scalar value of the given result type.
|
Type Parameters
Overrides
Exceptions
InternalExecuteScalarAsync<TResult>(String, QueryParameterCollection)
An asynchronous version of InternalExecuteScalar, which executes a SQL statement with parameters.
Declaration
protected override async Task<TResult> InternalExecuteScalarAsync<TResult>(string sqlText, QueryParameterCollection queryParameters)
Parameters
Type |
Name |
Description |
System.String |
sqlText |
SQL command text.
|
QueryParameterCollection |
queryParameters |
Query parameters that will be converted into
System.Data.Common.DbParameterCollection.
|
Returns
Type |
Description |
System.Threading.Tasks.Task<TResult> |
Scalar value of the given result type.
|
Type Parameters
Overrides
NewCommand()
Declaration
protected override DbCommand NewCommand()
Returns
Type |
Description |
System.Data.Common.DbCommand |
|
Overrides
NewConnection()
Declaration
protected override DbConnection NewConnection()
Returns
Type |
Description |
System.Data.Common.DbConnection |
|
Overrides
QueryParametersToDBParameters(QueryParameterCollection, DbParameterCollection)
Declaration
protected override void QueryParametersToDBParameters(QueryParameterCollection queryParameters, DbParameterCollection dbParameters)
Parameters
Overrides
SplitBatches(String)
Declaration
protected override IEnumerable<string> SplitBatches(string sqlText)
Parameters
Type |
Name |
Description |
System.String |
sqlText |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<System.String> |
|
Overrides
ValidateBatches(DbCommand, String, out String)
Declaration
protected override bool ValidateBatches(DbCommand command, string sqlText, out string message)
Parameters
Type |
Name |
Description |
System.Data.Common.DbCommand |
command |
|
System.String |
sqlText |
|
System.String |
message |
|
Returns
Type |
Description |
System.Boolean |
|
Overrides
Implements
System.IDisposable
Extension Methods
See Also