queryparser 0.3.2 is an R package that translates SQL SELECT statements into lists of R expressions, with functions for parsing, splitting, squishing and…
queryparser is an R package that translates SQL SELECT statements into lists of R expressions. It provides functions to parse a query or expression, split a query into clauses, extract column aliases, remove prefixes from column references, and squish whitespace and comments.
The package is maintained by Ian Cook and is licensed under the Apache License 2.0. It depends on no compilation and suggests testthat and covr for testing.
| Version | 0.3.2 |
|---|---|
| License | Apache License 2.0 |
| NeedsCompilation | no |
| Encoding | UTF-8 |
| Repository | CRAN |
| Date/Publication | 2023-01-09 21:20:02 UTC |
It translates SQL SELECT statements into lists of R expressions, returning an unevaluated R expression or a list of clause sublists.
Use extract_alias, which returns the expression with the alias assignment removed and the alias as its name.
Use squish_sql, which replaces every unquoted run of whitespace with a single space and removes line and block comments.
Use unqualify_query with a character vector of table names or aliases as prefixes, and optionally an except vector of column references to leave as is.