dbplyr (version 1.2.1)

sql_expr: Generate SQL from R expressions

Description

Low-level building block for generating SQL from R expressions. Strings are escaped; names become bare SQL identifiers. User infix functions have \% stripped.

Usage

sql_expr(x, con = sql_current_con())

Arguments

x

A quasiquoted expression

con

An optional database connection to control the details of the translation. The default, NULL, generates ANSI SQL.

Examples

Run this code
# NOT RUN {
sql_expr(f(x + 1))

sql_expr(f("x", "y"))
sql_expr(f(x, y))

sql_expr(cast("x" %as% DECIMAL))
sql_expr(round(x) %::% numeric)
# }

Run the code above in your browser using DataLab