Class PostgreSQLStatementParser (6.74.1)

public class PostgreSQLStatementParser extends AbstractStatementParser

Inheritance

java.lang.Object > AbstractStatementParser > PostgreSQLStatementParser

Methods

checkReturningClauseInternal(String rawSql)

protected boolean checkReturningClauseInternal(String rawSql)

Checks if the given SQL string contains a Returning clause. This method is used only in case of a DML statement.

Parameter
Name Description
rawSql String
Returns
Type Description
boolean
Overrides

getQueryParameters(String sql)

public Set<String> getQueryParameters(String sql)

Note: This is an internal API and breaking changes can be made without prior notice.

Returns the PostgreSQL-style query parameters ($1, $2, ...) in the given SQL string. The SQL-string is allowed to contain comments. Occurrences of query-parameter like strings inside quoted identifiers or string literals are ignored.

The following example will return a set containing ("$1", "$2"). select col1, col2, "col$4" from some_table where col1=$1 and col2=$2 and not col3=$1 and col4='$3'

Parameter
Name Description
sql String

the SQL-string to check for parameters.

Returns
Type Description
Set<String>

A set containing all the parameters in the SQL-string.

supportsExplain()

protected boolean supportsExplain()

Indicates whether the parser supports the EXPLAIN clause. The PostgreSQL parser does not support it.

Returns
Type Description
boolean
Overrides