Hide

YetaWF.DataProvider.PostgreSQL Package Documentation

Display
Print

YetaWF.DataProvider.PostgreSQL.SQLBase.Direct_QueryAsync Method

Executes the provided SQL statement(s).

Class: YetaWF.DataProvider.PostgreSQL.SQLBase
Namespace: YetaWF.DataProvider.PostgreSQL
Assembly: YetaWF.DataProvider.PostgreSQL

Syntax

public Task Direct_QueryAsync( string sql );
public Task<TYPE?> Direct_QueryAsync<TYPE>( string sql );
public Task Direct_QueryAsync(
    string sql,
    params object?[] args );
public Task<TYPE?> Direct_QueryAsync<TYPE>(
    string sql,
    params object?[] args );

Parameters

sql

The SQL statement(s).

args

Optional arguments that are passed when executing the SQL statements.

Remarks

This is used by application data providers to build and execute complex queries that are not possible with the standard data providers. Use of this method limits the application data provider to PostgreSQL repositories.

When using arguments, they are referenced in the SQL statement(s) sql using @p1, @p2, etc. where @p1 is replaced by the first optional argument. SQL injection attacks are not possible when using parameters.

See Also YetaWF.DataProvider.PostgreSQL.SQLBase ClassYetaWF.DataProvider.PostgreSQLYetaWF.Core