File: sqlParseVariables.Rd

package info (click to toggle)
dbi 1.2.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,004 kB
  • sloc: makefile: 2
file content (56 lines) | stat: -rw-r--r-- 1,644 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/interpolate.R, R/sqlParseVariables.R
\name{sqlCommentSpec}
\alias{sqlCommentSpec}
\alias{sqlQuoteSpec}
\alias{sqlParseVariablesImpl}
\alias{sqlParseVariables}
\title{Parse interpolated variables from SQL.}
\usage{
sqlCommentSpec(start, end, endRequired)

sqlQuoteSpec(start, end, escape = "", doubleEscape = TRUE)

sqlParseVariablesImpl(sql, quotes, comments)

sqlParseVariables(conn, sql, ...)
}
\arguments{
\item{start, end}{Start and end characters for quotes and comments}

\item{endRequired}{Is the ending character of a comment required?}

\item{escape}{What character can be used to escape quoting characters?
Defaults to \code{""}, i.e. nothing.}

\item{doubleEscape}{Can quoting characters be escaped by doubling them?
Defaults to \code{TRUE}.}

\item{sql}{SQL to parse (a character string)}

\item{quotes}{A list of \code{QuoteSpec} calls defining the quoting
specification.}

\item{comments}{A list of \code{CommentSpec} calls defining the commenting
specification.}
}
\description{
If you're implementing a backend that uses non-ANSI quoting or commenting
rules, you'll need to implement a method for \code{sqlParseVariables} that
calls \code{sqlParseVariablesImpl} with the appropriate quote and
comment specifications.
}
\examples{
# 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))
)
}
\keyword{internal}