What problem does it solve?
This Skill automates the complex process of converting R functions into their correct SQL equivalents for various database backends. It ensures that data operations are consistent, efficient, and accurate when working with different databases through dbplyr.
Core Features & Use Cases
- R-to-SQL Mapping: Provides a clear guide for defining how R functions (scalar, aggregate, window) are translated into database-specific SQL expressions.
- Backend Integration: Directs you on how to add these translations to specific
dbplyr backend files (e.g., SQLite, PostgreSQL, MySQL), extending dbplyr's capabilities.
- Use Case: When a new R function like
str_to_upper() needs to work with a PostgreSQL database via dbplyr, this skill guides you through adding the UPPER() SQL translation to the R/backend-postgres.R file, including the necessary research and testing steps.
Quick Start
Implement a new SQL translation for the R function my_custom_sum(x) to SUM(x) for the SQLite backend, ensuring it handles NULLs correctly.