Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Guides adding SQL function translations to dbplyr database backends, starting with required research via the sql-research skill.
54% 92%+38 ptsof test cases passed
Passed 22 of 24 test cases with the skill, and 13 of 24 without it.
3 of 3 safety checks passed
Not used yet
Use this skill when adding new SQL function translations for a specific database backend.
This skill guides you through adding SQL translations to dbplyr. SQL translations convert R functions to their SQL equivalents for different database backends.
Before implementing any SQL translation, you MUST research the SQL syntax and behavior using the sql-research skill. See that skill for the complete research workflow.
Quick summary:
research/{dialect}-{function}.mdSQL translations are defined in backend-specific files:
R/backend-sqlite.R - SQLiteR/backend-postgres.R - PostgreSQLR/backend-mysql.R - MySQLR/backend-mssql.R - MS SQL ServerTranslations are added to the sql_translation() method for the connection class. This method returns a sql_variant() with three components:
Scalar translations (for mutate/filter):
sql_translator(.parent = base_scalar,
# Simple function name mapping
log10 = function(x) sql_expr(log(!!x)),
# Function with different arguments
Skills that do similar work, with their benchmark result.
Next to this one in the catalogue, plus more from the same author.