We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
cur_column()
I tried to use across() to apply some custom sql to multiple columns. But I had no luck with it.
across()
library(dbplyr) library(dplyr, warn.conflicts = FALSE) iris %>% slice(1:2) %>% transmute(across(1:2, ~ sql(paste0(cur_column(), "::jsonb")))) #> Sepal.Length Sepal.Width #> 1 <SQL> Sepal.Length::jsonb <SQL> Sepal.Width::jsonb #> 2 <SQL> Sepal.Length::jsonb <SQL> Sepal.Width::jsonb iris_db <- tbl_memdb(iris) iris_db %>% transmute(across(1:2, ~ sql(paste0(cur_column(), "::jsonb")))) %>% show_query() #> <SQL> #> SELECT #> cur_column() || '::jsonb' AS `Sepal.Length`, #> cur_column() || '::jsonb' AS `Sepal.Width` #> FROM `iris` iris_db %>% transmute(across(1:2, ~ sql(!!paste0(cur_column(), "::jsonb")))) %>% show_query() #> Error in `cur_column()`: #> ! Must be used inside `across()`.
Created on 2022-07-29 by the reprex package (v2.0.1)
The text was updated successfully, but these errors were encountered:
sql(...)
Successfully merging a pull request may close this issue.
I tried to use
across()
to apply some custom sql to multiple columns. But I had no luck with it.Created on 2022-07-29 by the reprex package (v2.0.1)
The text was updated successfully, but these errors were encountered: