EVOLUTION-MANAGER
Edit File: sql_build.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Build and render SQL from a sequence of lazy operations</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for join_query {dbplyr}"><tr><td>join_query {dbplyr}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Build and render SQL from a sequence of lazy operations</h2> <h3>Description</h3> <p><code>sql_build()</code> creates a <code>select_query</code> S3 object, that is rendered to a SQL string by <code>sql_render()</code>. The output from <code>sql_build()</code> is designed to be easy to test, as it's database agnostic, and has a hierarchical structure. Outside of testing, however, you should always call <code>sql_render()</code>. </p> <h3>Usage</h3> <pre> join_query(x, y, vars, type = "inner", by = NULL, suffix = c(".x", ".y")) select_query( from, select = sql("*"), where = character(), group_by = character(), having = character(), order_by = character(), limit = NULL, distinct = FALSE ) semi_join_query(x, y, anti = FALSE, by = NULL) set_op_query(x, y, type = type) sql_build(op, con = NULL, ...) sql_render(query, con = NULL, ..., bare_identifier_ok = FALSE) sql_optimise(x, con = NULL, ...) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>op</code></td> <td> <p>A sequence of lazy operations</p> </td></tr> <tr valign="top"><td><code>con</code></td> <td> <p>A database connection. The default <code>NULL</code> uses a set of rules that should be very similar to ANSI 92, and allows for testing without an active database connection.</p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>Other arguments passed on to the methods. Not currently used.</p> </td></tr> <tr valign="top"><td><code>bare_identifier_ok</code></td> <td> <p>Is it ok to return a bare table identifier. Set to <code>TRUE</code> when generating queries to be nested within other queries where a bare table name is ok.</p> </td></tr> </table> <h3>Details</h3> <p><code>sql_build()</code> is generic over the lazy operations, <a href="lazy_ops.html">lazy_ops</a>, and generates an S3 object that represents the query. <code>sql_render()</code> takes a query object and then calls a function that is generic over the database. For example, <code>sql_build.op_mutate()</code> generates a <code>select_query</code>, and <code>sql_render.select_query()</code> calls <code>sql_select()</code>, which has different methods for different databases. The default methods should generate ANSI 92 SQL where possible, so you backends only need to override the methods if the backend is not ANSI compliant. </p> <hr /><div style="text-align: center;">[Package <em>dbplyr</em> version 1.4.4 <a href="00Index.html">Index</a>]</div> </body></html>