Last active
November 28, 2017 19:18
-
-
Save jimhester/350e770b8e31aa1fb6cff076a8c2f169 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
```{r setup} | |
library(DBI) | |
con <- dbConnect(RSQLite::SQLite(), ":memory:") | |
dbWriteTable(con, "mtcars", mtcars) | |
library(glue) | |
``` | |
```{r} | |
tbl <- "mtcars" | |
``` | |
```{r engine = "glue_sql", connection = "con"} | |
SELECT * FROM {`tbl`} where gear IN ({3:4*}) | |
``` | |
```{gluesql connection = "con"} | |
SELECT * FROM {`tbl`} where gear IN ({3:4*}) | |
``` | |
```{r engine = "glue"} | |
First three letters are {letters[1:3]} | |
``` | |
```{r engine = "glue"} | |
NA = {NA} | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment