Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updatiing translation chapter so it fulfill requirements of dbplyr latest version #1787

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions Translation.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@ The combination of first-class environments, lexical scoping, and metaprogrammin

```{r}
library(dbplyr)
translate_sql(x ^ 2)
translate_sql(x < 5 & !is.na(x))
translate_sql(!first %in% c("John", "Roger", "Robert"))
translate_sql(select == 7)

con <- simulate_dbi()

translate_sql(x ^ 2, con = con)
translate_sql(x < 5 & !is.na(x), con = con)
translate_sql(!first %in% c("John", "Roger", "Robert"), con = con)
translate_sql(select == 7, con = con)
```

Translating R to SQL is complex because of the many idiosyncrasies of SQL dialects, so here I'll develop two simple, but useful, domain specific languages (DSL): one to generate HTML, and the other to generate mathematical equations in LaTeX.
Expand Down