Learn R Programming

dbplyr (version 2.4.0)

db-quote: SQL escaping/quoting generics

Description

These generics translate individual values into SQL. The core generics are DBI::dbQuoteIdentifier() andDBI::dbQuoteString for quoting identifiers and strings, but dbplyr needs additional tools for inserting logical, date, date-time, and raw values into queries.

Usage

sql_escape_logical(con, x)

sql_escape_date(con, x)

sql_escape_datetime(con, x)

sql_escape_raw(con, x)

Arguments

See Also

Other generic: db-sql, db_connection_describe(), db_copy_to()

Examples

Run this code
con <- simulate_dbi()
sql_escape_logical(con, c(TRUE, FALSE, NA))
sql_escape_date(con, Sys.Date())
sql_escape_date(con, Sys.time())
sql_escape_raw(con, charToRaw("hi"))

Run the code above in your browser using DataLab