sql_options function

Options for generating SQL

Options for generating SQL

sql_options(cte = FALSE, use_star = TRUE, qualify_all_columns = FALSE)

Arguments

  • cte: If FALSE, the default, subqueries are used. If TRUE common table expressions are used.
  • use_star: If TRUE, the default, * is used to select all columns of a table. If FALSE all columns are explicitly selected.
  • qualify_all_columns: If FALSE, the default, columns are only qualified with the table they come from if the same column name appears in multiple tables.

Returns

A <dbplyr_sql_options> object.

Examples

library(dplyr, warn.conflicts = FALSE) lf1 <- lazy_frame(key = 1, a = 1, b = 2) lf2 <- lazy_frame(key = 1, a = 1, c = 3) result <- left_join(lf1, lf2, by = "key") %>% filter(c >= 3) show_query(result) sql_options <- sql_options(cte = TRUE, qualify_all_columns = TRUE) show_query(result, sql_options = sql_options)
  • Maintainer: Hadley Wickham
  • License: MIT + file LICENSE
  • Last published: 2024-03-19