Parse interpolated variables from SQL.
If you're implementing a backend that uses non-ANSI quoting or commenting
rules, you'll need to implement a method for sqlParseVariables
that
calls sqlParseVariablesImpl
with the appropriate quote and
comment specifications.
sqlParseVariables(conn, sql, ...) sqlCommentSpec(start, end, endRequired) sqlQuoteSpec(start, end, escape = "", doubleEscape = TRUE) sqlParseVariablesImpl(sql, quotes, comments)
sql |
SQL to parse (a character string) |
start, end |
Start and end characters for quotes and comments |
endRequired |
Is the ending character of a comment required? |
escape |
What character can be used to escape quoting characters?
Defaults to |
doubleEscape |
Can quoting characters be escaped by doubling them?
Defaults to |
quotes |
A list of |
comments |
A list of |
# Use [] for quoting and no comments sqlParseVariablesImpl("[?a]", list(sqlQuoteSpec("[", "]", "\\", FALSE)), list() ) # Standard quotes, use # for commenting sqlParseVariablesImpl("# ?a\n?b", list(sqlQuoteSpec("'", "'"), sqlQuoteSpec('"', '"')), list(sqlCommentSpec("#", "\n", FALSE)) )
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.