Skip to content

Commit

Permalink
Pass on ... in db_sql_render() (#1428)
Browse files Browse the repository at this point in the history
Fixes #1394
  • Loading branch information
hadley authored Jan 10, 2024
1 parent 260690c commit c50f26d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# dbplyr (development version)

* `db_sql_render()` correctly passes on `...` when re-calling with
`sql_options` set (#1394).

* `-1 + x` is now translated correctly (#1420).

* SQL server: clear error if you attempt to use `n_distinct()` in `mutate()`
Expand Down
6 changes: 3 additions & 3 deletions R/db.R
Original file line number Diff line number Diff line change
Expand Up @@ -60,20 +60,20 @@ sql_join_suffix.DBIConnection <- function(con, suffix, ...) {
db_sql_render <- function(con, sql, ..., cte = FALSE, sql_options = NULL) {
check_bool(cte)
if (cte) {
lifecycle::deprecate_soft(
lifecycle::deprecate_soft(
when = "2.4.0",
what = "db_sql_render(cte)",
with = I("db_sql_render(sql_options = sql_options(cte = TRUE))")
)
sql_options <- sql_options %||% sql_options(cte = TRUE)
out <- db_sql_render(con, sql, sql_options = sql_options)
out <- db_sql_render(con, sql, ..., sql_options = sql_options)
return(out)
}

if (is.null(sql_options)) {
sql_options <- sql_options()

out <- db_sql_render(con, sql, sql_options = sql_options)
out <- db_sql_render(con, sql, ..., sql_options = sql_options)
return(out)
}

Expand Down

0 comments on commit c50f26d

Please sign in to comment.