diff --git a/R/backend-postgres.R b/R/backend-postgres.R index 5f9f0ba6f..288849bde 100644 --- a/R/backend-postgres.R +++ b/R/backend-postgres.R @@ -216,12 +216,14 @@ sql_translation.PqConnection <- function(con) { postgres_period(x, "hours") }, days = function(x) { + # lubridate::days() (base::days() does not exist) postgres_period(x, "days") }, weeks = function(x) { postgres_period(x, "weeks") }, months = function(x) { + # base::months() (or applicable methods from lubridate, e.g., months.numeric) postgres_period(x, "months") }, years = function(x) { diff --git a/R/backend-snowflake.R b/R/backend-snowflake.R index afb696f2d..d27f5ad7e 100644 --- a/R/backend-snowflake.R +++ b/R/backend-snowflake.R @@ -100,9 +100,7 @@ sql_translation.Snowflake <- function(con) { str_squish = function(string) { sql_expr(regexp_replace(trim(!!string), "\\\\s+", " ")) }, - - - # lubridate functions + # date functions (e.g., from lubridate or ?base::weekdays) # https://docs.snowflake.com/en/sql-reference/functions-date-time.html day = function(x) { sql_expr(EXTRACT(DAY %FROM% !!x)) @@ -188,12 +186,14 @@ sql_translation.Snowflake <- function(con) { glue_sql2(sql_current_con(), "INTERVAL '{.val x} hour'") }, days = function(x) { + # lubridate::days() (base::days() does not exist) glue_sql2(sql_current_con(), "INTERVAL '{.val x} day'") }, weeks = function(x) { glue_sql2(sql_current_con(), "INTERVAL '{.val x} week'") }, months = function(x) { + # base::months() (or applicable methods from lubridate, e.g., months.numeric) glue_sql2(sql_current_con(), "INTERVAL '{.val x} month'") }, years = function(x) {