Note
This class should not be considered as pgjdbc public API.
| Modifier and Type | Class and Description |
|---|---|
| private static enum |
| Modifier and Type | Field and Description |
|---|---|
| private static final char[] | |
| private static final char[] | |
| private static final char[] |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private static boolean | addReturning(StringBuilder nativeSql, SqlCommandType currentCommandType, String[] returningColumnNames, boolean isReturningPresent, boolean quoteReturningIdentifiers)
|
| public static boolean | |
| private static void | |
| public static int | |
| private static int | |
| private static int | Returns: the right PostgreSQL sqldestination StringBuilder newsql, String the escaped function name functionName, char[] input SQL text (containing arguments of a function call with possible JDBC escapes) sql, int position in the input SQL i, boolean whether standard_conforming_strings is on stdStrings)Generate sql for escaped functions. |
| private static int | |
| public static boolean | Returns: Indication if the character is a whitespace which back end will escape.Character to examine. c)Identifies white space characters which the backend uses to determine if a
|
| public static boolean | |
| public static boolean | Returns: true if valid as second or later character of a dollar quoting tag; false if notthe character to check c)Checks if a character is valid as the second or later character of a dollar quoting tag. |
| public static boolean | Returns: true if valid as first character of a dollar quoting tag; false if notthe character to check c)Checks if a character is valid as the start of a dollar quoting tag. |
| public static boolean | Returns: true if valid as second or later character of an identifier; false if notthe character to check c)Checks if a character is valid as the second or later character of an identifier. |
| public static boolean | Returns: true if valid as first character of an identifier; false if notthe character to check c)Checks if a character is valid as the start of an identifier. |
| public static boolean | Returns: true if the given character is a valid character for an operator in the backend's parsercharacter c)
|
| public static boolean | Returns: true if the character is a whitespace character as defined in the backend's parsercharacter c)Identifies characters which the backend scanner considers to be whitespace. |
| public static JdbcCallParseInfo | Returns: SQL in appropriate for given server formatsql text with JDBC escapes jdbcSql, boolean if backslash in single quotes should be regular character or escape one stdStrings, int server version serverVersion, int protocol version protocolVersion, EscapeSyntaxCallMode mode specifying whether JDBC escape call syntax is transformed into a CALL/SELECT statement escapeSyntaxCallMode)Converts JDBC-specific callable statement escapes |
| public static boolean | Returns: boolean indicates presence of wordchar[] of the query statement query, int position of query to start checking offset)Parse string to check presence of CREATE keyword regardless of case. |
| public static boolean | Returns: boolean indicates presence of wordchar[] of the query statement query, int position of query to start checking offset)Parse string to check presence of AS keyword regardless of case. |
| public static boolean | Returns: boolean indicates presence of wordchar[] of the query statement query, int position of query to start checking offset)Parse string to check presence of ATOMIC keyword regardless of case. |
| public static boolean | Returns: boolean indicates presence of wordchar[] of the query statement query, int position of query to start checking offset)Parse string to check presence of BEGIN keyword regardless of case. |
| public static int | Returns: position of the last/ characterquery query, int start offset offset)Test if the |
| public static boolean | Returns: boolean indicates presence of wordchar[] of the query statement query, int position of query to start checking offset)Parse string to check presence of CREATE keyword regardless of case. |
| public static boolean | Returns: boolean indicates presence of wordchar[] of the query statement query, int position of query to start checking offset)Parse string to check presence of DELETE keyword regardless of case. |
| public static int | Returns: offset of the ending dollar characterquery query, int start offset offset)Test if the dollar character ( |
| public static int | Returns: position of the end of the double-quoted stringquery query, int start offset offset)Find the end of the double-quoted string starting at the given offset. |
| public static boolean | Returns: boolean indicates presence of wordchar[] of the query statement query, int position of query to start checking offset)Parse string to check presence of INSERT keyword regardless of case. |
| public static List | Returns: list of native queriesjdbc query to parse query, boolean whether to allow backslashes to be used as escape characters
in single quote literals standardConformingStrings, boolean whether to replace ?, ? with $1, $2, etc withParameters, boolean whether to split statements by semicolon splitStatements, boolean whether re-write optimization is enabled isBatchedReWriteConfigured, boolean whether to quote identifiers returned using returning clause quoteReturningIdentifiers, String... for simple insert, update, delete add returning with given column names returningColumnNames)Parses JDBC query into PostgreSQL's native format. |
| public static int | Returns: position of the first\r or \n characterquery query, int start offset offset)Test if the |
| public static long | Returns: long valuestring to parse s, int begin index beginIndex, int end index endIndex)Faster version of |
| public static boolean | Returns: boolean indicates presence of wordchar[] of the query statement query, int position of query to start checking offset)Parse string to check presence of MOVE keyword regardless of case. |
| public static boolean | Returns: boolean indicates presence of wordchar[] of the query statement query, int position of query to start checking offset)Parse string to check presence of RETURNING keyword regardless of case. |
| public static boolean | Returns: boolean indicates presence of wordchar[] of the query statement query, int position of query to start checking offset)Parse string to check presence of SELECT keyword regardless of case. |
| public static int | Returns: position of the end of the single-quoted stringquery query, int start offset offset, boolean standard conforming strings standardConformingStrings)Find the end of the single-quoted string starting at the given offset. |
| private static int | Returns: the position we stopped processing atthe original query text sql, int starting position for replacing i, StringBuilder where to write the replaced output newsql, boolean should we stop after hitting the first comma in sql text? stopOnComma, boolean whether standard_conforming_strings is on stdStrings)parse the given sql from index i, appending it to the given buffer until we hit an unmatched right parentheses or end of string. |
| public static boolean | Returns: boolean indicates presence of wordchar[] of the query statement query, int position of query to start checking offset)Parse string to check presence of UPDATE keyword regardless of case. |
| public static boolean | Returns: boolean indicates presence of wordchar[] of the query statement query, int position of query to start checking offset)Parse string to check presence of VALUES keyword regardless of case. |
| private static @Nullable SqlCommandType | |
| public static boolean | Returns: boolean indicates presence of wordchar[] of the query statement query, int position of query to start checking offset)Parse string to check presence of WITH keyword regardless of case. |
| public static String | Returns: PostgreSQL-compatible SQLthe original query text sql, boolean whether replace_processing_enabled is on replaceProcessingEnabled, boolean whether standard_conforming_strings is on standardConformingStrings)Filter the SQL string of Java SQL Escape clauses. |
| private static boolean | Returns: true if the sub-arrays are equal; false if nota char array arr, final int first sub-array start offset offA, final int second sub-array start offset offB, final int length of the sub arrays to compare len)Compares two sub-arrays of the given character array for equalness. |
| private static @Nullable int[] |
| QUOTE_OR_ALPHABETIC_MARKER | back to summary |
|---|---|
| private static final char[] QUOTE_OR_ALPHABETIC_MARKER | |
| QUOTE_OR_ALPHABETIC_MARKER_OR_PARENTHESIS | back to summary |
|---|---|
| private static final char[] QUOTE_OR_ALPHABETIC_MARKER_OR_PARENTHESIS | |
| SINGLE_QUOTE | back to summary |
|---|---|
| private static final char[] SINGLE_QUOTE | |
| Parser | back to summary |
|---|---|
| public Parser() | |
| addReturning | back to summary |
|---|---|
| private static boolean addReturning(StringBuilder nativeSql, SqlCommandType currentCommandType, String[] returningColumnNames, boolean isReturningPresent, boolean quoteReturningIdentifiers) throws SQLException | |
| charTerminatesIdentifier | back to summary |
|---|---|
public static boolean charTerminatesIdentifier(char c)
| |
| checkParsePosition | back to summary |
|---|---|
| private static void checkParsePosition(int i, int len, int i0, char[] sql, String message) throws PSQLException | |
| digitAt | back to summary |
|---|---|
| public static int digitAt(String s, int pos) Converts digit at position
| |
| escapeFunction | back to summary |
|---|---|
| private static int escapeFunction(char[] sql, int i, StringBuilder newsql, boolean stdStrings) throws SQLException | |
| escapeFunctionArguments | back to summary |
|---|---|
| private static int escapeFunctionArguments(StringBuilder newsql, String functionName, char[] sql, int i, boolean stdStrings) throws SQLException Generate sql for escaped functions.
| |
| findOpenParenthesis | back to summary |
|---|---|
| private static int findOpenParenthesis(char[] sql, int i) | |
| isArrayWhiteSpace | back to summary |
|---|---|
| public static boolean isArrayWhiteSpace(char c) Identifies white space characters which the backend uses to determine if a
https://github.com/postgres/postgres/blob/f2c587067a8eb9cf1c8f009262381a6576ba3dd0/src/backend/utils/adt/arrayfuncs.c#L421-L438
| |
| isDigitAt | back to summary |
|---|---|
| public static boolean isDigitAt(String s, int pos) Returns true if a given string
| |
| isDollarQuoteContChar | back to summary |
|---|---|
| public static boolean isDollarQuoteContChar(char c) Checks if a character is valid as the second or later character of a dollar quoting tag.
| |
| isDollarQuoteStartChar | back to summary |
|---|---|
| public static boolean isDollarQuoteStartChar(char c) Checks if a character is valid as the start of a dollar quoting tag.
| |
| isIdentifierContChar | back to summary |
|---|---|
| public static boolean isIdentifierContChar(char c) Checks if a character is valid as the second or later character of an identifier.
| |
| isIdentifierStartChar | back to summary |
|---|---|
| public static boolean isIdentifierStartChar(char c) Checks if a character is valid as the start of an identifier. PostgreSQL 9.4 allows column names like _, ‿, ⁀, ⁔, ︳, ︴, ﹍, ﹎, ﹏, _, so it is assumed isJavaIdentifierPart is good enough for PostgreSQL.
| |
| isOperatorChar | back to summary |
|---|---|
public static boolean isOperatorChar(char c)
| |
| isSpace | back to summary |
|---|---|
| public static boolean isSpace(char c) Identifies characters which the backend scanner considers to be whitespace. https://github.com/postgres/postgres/blob/17bb62501787c56e0518e61db13a523d47afd724/src/backend/parser/scan.l#L194-L198
| |
| modifyJdbcCall | back to summary |
|---|---|
| public static JdbcCallParseInfo modifyJdbcCall(String jdbcSql, boolean stdStrings, int serverVersion, int protocolVersion, EscapeSyntaxCallMode escapeSyntaxCallMode) throws SQLException Converts JDBC-specific callable statement escapes
| |
| parseAlterKeyword | back to summary |
|---|---|
| public static boolean parseAlterKeyword(final char[] query, int offset) Parse string to check presence of CREATE keyword regardless of case.
| |
| parseAsKeyword | back to summary |
|---|---|
| public static boolean parseAsKeyword(final char[] query, int offset) Parse string to check presence of AS keyword regardless of case.
| |
| parseAtomicKeyword | back to summary |
|---|---|
| public static boolean parseAtomicKeyword(final char[] query, int offset) Parse string to check presence of ATOMIC keyword regardless of case.
| |
| parseBeginKeyword | back to summary |
|---|---|
| public static boolean parseBeginKeyword(final char[] query, int offset) Parse string to check presence of BEGIN keyword regardless of case.
| |
| parseBlockComment | back to summary |
|---|---|
| public static int parseBlockComment(final char[] query, int offset) Test if the
| |
| parseCreateKeyword | back to summary |
|---|---|
| public static boolean parseCreateKeyword(final char[] query, int offset) Parse string to check presence of CREATE keyword regardless of case.
| |
| parseDeleteKeyword | back to summary |
|---|---|
| public static boolean parseDeleteKeyword(final char[] query, int offset) Parse string to check presence of DELETE keyword regardless of case. The initial character is assumed to have been matched.
| |
| parseDollarQuotes | back to summary |
|---|---|
| public static int parseDollarQuotes(final char[] query, int offset) Test if the dollar character (
| |
| parseDoubleQuotes | back to summary |
|---|---|
| public static int parseDoubleQuotes(final char[] query, int offset) Find the end of the double-quoted string starting at the given offset. Note for
| |
| parseInsertKeyword | back to summary |
|---|---|
| public static boolean parseInsertKeyword(final char[] query, int offset) Parse string to check presence of INSERT keyword regardless of case.
| |
| parseJdbcSql | back to summary |
|---|---|
| public static List Parses JDBC query into PostgreSQL's native format. Several queries might be given if separated by semicolon.
| |
| parseLineComment | back to summary |
|---|---|
| public static int parseLineComment(final char[] query, int offset) Test if the
| |
| parseLong | back to summary |
|---|---|
| public static long parseLong(String s, int beginIndex, int endIndex) Faster version of
| |
| parseMoveKeyword | back to summary |
|---|---|
| public static boolean parseMoveKeyword(final char[] query, int offset) Parse string to check presence of MOVE keyword regardless of case.
| |
| parseReturningKeyword | back to summary |
|---|---|
| public static boolean parseReturningKeyword(final char[] query, int offset) Parse string to check presence of RETURNING keyword regardless of case.
| |
| parseSelectKeyword | back to summary |
|---|---|
| public static boolean parseSelectKeyword(final char[] query, int offset) Parse string to check presence of SELECT keyword regardless of case.
| |
| parseSingleQuotes | back to summary |
|---|---|
| public static int parseSingleQuotes(final char[] query, int offset, boolean standardConformingStrings) Find the end of the single-quoted string starting at the given offset. Note for
| |
| parseSql | back to summary |
|---|---|
| private static int parseSql(char[] sql, int i, StringBuilder newsql, boolean stopOnComma, boolean stdStrings) throws SQLException parse the given sql from index i, appending it to the given buffer until we hit an unmatched right parentheses or end of string. When the stopOnComma flag is set we also stop processing when a comma is found in sql text that isn't inside nested parenthesis.
| |
| parseUpdateKeyword | back to summary |
|---|---|
| public static boolean parseUpdateKeyword(final char[] query, int offset) Parse string to check presence of UPDATE keyword regardless of case.
| |
| parseValuesKeyword | back to summary |
|---|---|
| public static boolean parseValuesKeyword(final char[] query, int offset) Parse string to check presence of VALUES keyword regardless of case.
| |
| parseWithCommandType | back to summary |
|---|---|
| private static @Nullable SqlCommandType parseWithCommandType(char[] aChars, int i, int keywordStart, int wordLength) | |
| parseWithKeyword | back to summary |
|---|---|
| public static boolean parseWithKeyword(final char[] query, int offset) Parse string to check presence of WITH keyword regardless of case.
| |
| replaceProcessing | back to summary |
|---|---|
| public static String replaceProcessing(String sql, boolean replaceProcessingEnabled, boolean standardConformingStrings) throws SQLException Filter the SQL string of Java SQL Escape clauses. Currently implemented Escape clauses are those mentioned in 11.3 in the specification. Basically we look through the sql string for {d xxx}, {t xxx}, {ts xxx}, {oj xxx} or {fn xxx} in non-string sql code. When we find them, we just strip the escape part leaving only the xxx part. So, something like "select * from x where d={d '2001-10-09'}" would return "select * from x where d= '2001-10-09'".
| |
| subArraysEqual | back to summary |
|---|---|
| private static boolean subArraysEqual(final char[] arr, final int offA, final int offB, final int len) Compares two sub-arrays of the given character array for equalness. If the length is zero, the result is true if and only if the offsets are within the bounds of the array.
| |
| toIntArray | back to summary |
|---|---|
| private static @Nullable int[] toIntArray(@Nullable IntList list) Converts | |
| Modifier and Type | Field and Description |
|---|---|
| private final char[] | |
| public static final Parser. | |
| public static final Parser. | |
| public static final Parser. | |
| public static final Parser. | |
| public static final Parser. | |
| public static final Parser. | |
| private final char[] | |
| public static final Parser. | |
| private final @Nullable String | |
| private static final Parser. |
| Access | Constructor and Description |
|---|---|
| private | |
| private |
| Modifier and Type | Method and Description |
|---|---|
| private int | |
| private boolean | |
| public static Parser. | |
| public static Parser. |
| allowedValues | back to summary |
|---|---|
| private final char[] allowedValues | |
| ESC_DATE | back to summary |
|---|---|
| public static final Parser. | |
| ESC_ESCAPECHAR | back to summary |
|---|---|
| public static final Parser. | |
| ESC_FUNCTION | back to summary |
|---|---|
| public static final Parser. | |
| ESC_OUTERJOIN | back to summary |
|---|---|
| public static final Parser. | |
| ESC_TIME | back to summary |
|---|---|
| public static final Parser. | |
| ESC_TIMESTAMP | back to summary |
|---|---|
| public static final Parser. | |
| escapeKeyword | back to summary |
|---|---|
| private final char[] escapeKeyword | |
| IN_SQLCODE | back to summary |
|---|---|
| public static final Parser. | |
| replacementKeyword | back to summary |
|---|---|
| private final @Nullable String replacementKeyword | |
| VALUES | back to summary |
|---|---|
| private static final Parser. | |
| SqlParseState | back to summary |
|---|---|
| private SqlParseState() | |
| SqlParseState | back to summary |
|---|---|
| private SqlParseState(String escapeKeyword, char[] allowedValues, @Nullable String replacementKeyword) | |
| getMatchedPosition | back to summary |
|---|---|
| private int getMatchedPosition(char[] sql, int pos) | |
| startMatches | back to summary |
|---|---|
| private boolean startMatches(char[] sql, int pos) | |
| valueOf | back to summary |
|---|---|
| public static Parser. | |
| values | back to summary |
|---|---|
| public static Parser. | |