Yes, you can try doing that. Below are couple of examples to illustrate usage of sql_render and how it can help you understand what actually will happen in DB:
library(dplyr)
#>
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#>
#> filter, lag
#> The following objects are masked from 'package:base':
#>
#> intersect, setdiff, setequal, union
library(dbplyr)
#>
#> Attaching package: 'dbplyr'
#> The following objects are masked from 'package:dplyr':
#>
#> ident, sql
res <- dbplyr::tbl_memdb(iris)
res %>%
dplyr::group_by(Species) %>%
dplyr::summarise(n = dplyr::n()) %>%
dbplyr::sql_render()
#> <SQL> SELECT `Species`, COUNT() AS `n`
#> FROM `iris`
#> GROUP BY `Species`
today <- as.character(Sys.time())
res_with_dtm <- res %>%
dplyr::mutate(dtm = today)
# dtm is character, not datetime
res_with_dtm
#> # Source: lazy query [?? x 6]
#> # Database: sqlite 3.29.0 [:memory:]
#> Sepal.Length Sepal.Width Petal.Length Petal.Width Species dtm
#> <dbl> <dbl> <dbl> <dbl> <chr> <chr>
#> 1 5.1 3.5 1.4 0.2 setosa 2019-08-03 16…
#> 2 4.9 3 1.4 0.2 setosa 2019-08-03 16…
#> 3 4.7 3.2 1.3 0.2 setosa 2019-08-03 16…
#> 4 4.6 3.1 1.5 0.2 setosa 2019-08-03 16…
#> 5 5 3.6 1.4 0.2 setosa 2019-08-03 16…
#> 6 5.4 3.9 1.7 0.4 setosa 2019-08-03 16…
#> 7 4.6 3.4 1.4 0.3 setosa 2019-08-03 16…
#> 8 5 3.4 1.5 0.2 setosa 2019-08-03 16…
#> 9 4.4 2.9 1.4 0.2 setosa 2019-08-03 16…
#> 10 4.9 3.1 1.5 0.1 setosa 2019-08-03 16…
#> # … with more rows
# STRFTIME is from SQLite, not R
res_with_dtm %>%
dplyr::mutate(dtm = STRFTIME('%d', dtm))
#> # Source: lazy query [?? x 6]
#> # Database: sqlite 3.29.0 [:memory:]
#> Sepal.Length Sepal.Width Petal.Length Petal.Width Species dtm
#> <dbl> <dbl> <dbl> <dbl> <chr> <chr>
#> 1 5.1 3.5 1.4 0.2 setosa 03
#> 2 4.9 3 1.4 0.2 setosa 03
#> 3 4.7 3.2 1.3 0.2 setosa 03
#> 4 4.6 3.1 1.5 0.2 setosa 03
#> 5 5 3.6 1.4 0.2 setosa 03
#> 6 5.4 3.9 1.7 0.4 setosa 03
#> 7 4.6 3.4 1.4 0.3 setosa 03
#> 8 5 3.4 1.5 0.2 setosa 03
#> 9 4.4 2.9 1.4 0.2 setosa 03
#> 10 4.9 3.1 1.5 0.1 setosa 03
#> # … with more rows
res_with_dtm %>%
dplyr::mutate(dtm = STRFTIME('%d', dtm)) %>%
dbplyr::sql_render()
#> <SQL> SELECT `Sepal.Length`, `Sepal.Width`, `Petal.Length`, `Petal.Width`, `Species`, STRFTIME('%d', `dtm`) AS `dtm`
#> FROM (SELECT `Sepal.Length`, `Sepal.Width`, `Petal.Length`, `Petal.Width`, `Species`, '2019-08-03 16:14:35' AS `dtm`
#> FROM `iris`)
Created on 2019-08-03 by the reprex package (v0.3.0)