Interface SqlParser

All Known Implementing Classes:
ColonPrefixSqlParser, HashPrefixSqlParser

public interface SqlParser
Parses the named parameters out of an SQL statement, and returns the ParsedSql containing the JDBC-ready SQL statement, along with the type of parameters used (named or positional), the number, and the parameter name for each position (if applicable).
  • Method Details

    • parse

      ParsedSql parse(String sql, StatementContext ctx)
      Parses the given SQL statement, and returns the ParsedSql for the statement.
      Parameters:
      sql - The SQL statement to parse
      ctx - The statement context for the statement being executed
      Returns:
      the parsed SQL representing the SQL statement itself along with information about the parameters which should be bound (number and names)
    • nameParameter

      String nameParameter(String rawName, StatementContext ctx)
      Convert rawName to a name as recognized by this parser
      Parameters:
      rawName - the raw name to transform
      ctx - The statement context for the statement being executed
      Returns:
      a name appropriate for being identified a a named parameter by this parser