Skip to content

This backend supports Amazon Redshift databases, typically accessed via a RedshiftConnection created by DBI::dbConnect(). Use dialect_redshift() with lazy_frame() to see simulated SQL without connecting to a live database.

Base translations come from PostgreSQL backend. There are generally few differences, apart from string manipulation.

See vignette("translation-function") and vignette("translation-verb") for details of overall translation technology.

Usage

dialect_redshift()

simulate_redshift()

Examples

library(dplyr, warn.conflicts = FALSE)

lf <- lazy_frame(a = TRUE, b = 1, c = 2, d = "z", con = dialect_redshift())
lf |> transmute(x = paste(c, " times"))
#> <SQL>
#> SELECT "c" || ' ' || ' times' AS "x"
#> FROM "df"
lf |> transmute(x = substr(c, 2, 3))
#> <SQL>
#> SELECT SUBSTRING("c", 2, 2) AS "x"
#> FROM "df"
lf |> transmute(x = str_replace_all(c, "a", "z"))
#> <SQL>
#> SELECT REGEXP_REPLACE("c", 'a', 'z') AS "x"
#> FROM "df"