sql-translation — database sql-translation, dbplyr, community, database, ide skills

v1.0.0

关于此技能

Database (DBI) backend for dplyr

# 核心主题

tidyverse tidyverse
[509]
[188]
更新于: 4/3/2026

Killer-Skills Review

Decision support comes first. Repository text comes second.

Reference-Only Page Review Score: 1/11

This page remains useful for operators, but Killer-Skills treats it as reference material instead of a primary organic landing page.

Review Score
1/11
Quality Score
41
Canonical Locale
en
Detected Body Locale
en

Database (DBI) backend for dplyr

核心价值

Database (DBI) backend for dplyr

适用 Agent 类型

Suitable for operator workflows that need explicit guardrails before installation and execution.

赋予的主要能力 · sql-translation

! 使用限制与门槛

Why this page is reference-only

  • - Current locale does not satisfy the locale-governance contract.
  • - The page lacks a strong recommendation layer.
  • - The page lacks concrete use-case guidance.
  • - The page lacks explicit limitations or caution signals.
  • - The underlying skill quality score is below the review floor.

Source Boundary

The section below is imported from the upstream repository and should be treated as secondary evidence. Use the Killer-Skills review above as the primary layer for fit, risk, and installation decisions.

评审后的下一步

先决定动作,再继续看上游仓库材料

Killer-Skills 的主价值不应该停在“帮你打开仓库说明”,而是先帮你判断这项技能是否值得安装、是否应该回到可信集合复核,以及是否已经进入工作流落地阶段。

实验室 Demo

Browser Sandbox Environment

⚡️ Ready to unleash?

Experience this Agent in a zero-setup browser environment powered by WebContainers. No installation required.

Boot Container Sandbox

常见问题与安装步骤

以下问题与步骤与页面结构化数据保持一致,便于搜索引擎理解页面内容。

? FAQ

sql-translation 是什么?

Database (DBI) backend for dplyr

如何安装 sql-translation?

运行命令:npx killer-skills add tidyverse/dbplyr/sql-translation。支持 Cursor、Windsurf、VS Code、Claude Code 等 19+ IDE/Agent。

sql-translation 支持哪些 IDE 或 Agent?

该技能兼容 Cursor, Windsurf, VS Code, Trae, Claude Code, OpenClaw, Aider, Codex, OpenCode, Goose, Cline, Roo Code, Kiro, Augment Code, Continue, GitHub Copilot, Sourcegraph Cody, and Amazon Q Developer。可使用 Killer-Skills CLI 一条命令通用安装。

安装步骤

  1. 1. 打开终端

    在你的项目目录中打开终端或命令行。

  2. 2. 执行安装命令

    运行:npx killer-skills add tidyverse/dbplyr/sql-translation。CLI 会自动识别 IDE 或 AI Agent 并完成配置。

  3. 3. 开始使用技能

    sql-translation 已启用,可立即在当前项目中调用。

! 参考页模式

此页面仍可作为安装与查阅参考,但 Killer-Skills 不再把它视为主要可索引落地页。请优先阅读上方评审结论,再决定是否继续查看上游仓库说明。

Upstream Repository Material

The section below is imported from the upstream repository and should be treated as secondary evidence. Use the Killer-Skills review above as the primary layer for fit, risk, and installation decisions.

Upstream Source

sql-translation

Database (DBI) backend for dplyr

SKILL.md
Readonly
Upstream Repository Material
The section below is imported from the upstream repository and should be treated as secondary evidence. Use the Killer-Skills review above as the primary layer for fit, risk, and installation decisions.
Supporting Evidence

SQL Translation Skill

Use this skill when adding new SQL function translations for a specific database backend.

Overview

This skill guides you through adding SQL translations to dbplyr. SQL translations convert R functions to their SQL equivalents for different database backends.

Workflow

1. Research SQL (CRITICAL - ALWAYS FIRST)

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:

  • Search official documentation for "{dialect} {function}"
  • Document findings in research/{dialect}-{function}.md
  • Include all source URLs
  • Only proceed to implementation after completing research

2. Identify the backend file

SQL translations are defined in backend-specific files:

  • R/backend-sqlite.R - SQLite
  • R/backend-postgres.R - PostgreSQL
  • R/backend-mysql.R - MySQL
  • R/backend-mssql.R - MS SQL Server
  • etc.

3. Add translation

Translations 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):

r
1sql_translator(.parent = base_scalar, 2 # Simple function name mapping 3 log10 = \(x) sql_glue("LOG({x}) / LOG(10)"), 4 5 # Function with different arguments 6 round = function(x, digits = 0L) { 7 digits <- as.integer(digits) 8 sql_glue("ROUND(CAST({x} AS NUMERIC), {.val digits})") 9 }, 10 11 # Infix operators 12 paste0 = sql_paste_infix("", "||"), 13 14 # Complex logic 15 grepl = function(pattern, x, ignore.case = FALSE) { 16 if (ignore.case) { 17 sql_glue("{x} ~* {pattern}") 18 } else { 19 sql_glue("{x} ~ {pattern}") 20 } 21 } 22)

Aggregate translations (for summarise):

r
1sql_translator(.parent = base_agg, 2 sd = sql_aggregate("STDEV", "sd"), 3 median = sql_aggregate("MEDIAN"), 4 quantile = sql_not_supported("quantile") 5)

Window translations (for mutate with groups):

r
1sql_translator(.parent = base_win, 2 sd = win_aggregate("STDEV"), 3 median = win_absent("median"), 4 quantile = sql_not_supported("quantile") 5)

4. Helper functions

Common translation patterns:

  • sql_glue() - Build SQL expressions with {x} for interpolation
  • {.val x} - Interpolate literal R values (not SQL expressions)
  • sql_cast(type) - Type casting (e.g., sql_cast("REAL"))
  • sql_aggregate(sql_name, r_name) - Simple aggregates
  • sql_paste_infix(sep, op) - String concatenation with infix operator
  • sql_not_supported(name) - Mark unsupported functions
  • win_aggregate(sql_name) - Window aggregates
  • win_absent(name) - Window functions not supported

5. Test the translation

Interactive testing:

r
1Rscript -e "devtools::load_all(); library(dplyr, warn.conflicts = FALSE); 2 translate_sql(your_function(x), con = simulate_yourdb())"

Write tests:

  • Tests for R/{name}.R go in tests/testthat/test-{name}.R
  • Place new tests next to similar existing tests
  • Keep tests minimal with few comments

Example test:

r
1test_that("backend_name translates function_name correctly", { 2 lf <- lazy_frame(x = 1, con = simulate_backend()) 3 4 expect_snapshot( 5 lf |> mutate(y = your_function(x)) 6 ) 7})

6. Document the translation

Update backend documentation:

  • Edit the @description section in the backend file (e.g., R/backend-postgres.R)
  • List key translation differences
  • Add examples to @examples if helpful

Example:

r
1#' Backend: PostgreSQL 2#' 3#' @description 4#' See `vignette("translation-function")` and `vignette("translation-verb")` for 5#' details of overall translation technology. Key differences for this backend 6#' are: 7#' 8#' * Many stringr functions 9#' * lubridate date-time extraction functions 10#' * Your new translation

7. Format and check

bash
1# Format code 2air format . 3 4# Run relevant tests 5Rscript -e "devtools::test(filter = 'backend-name', reporter = 'llm')" 6 7# Check documentation 8Rscript -e "devtools::document()"

Key concepts

Parent translators:

  • base_scalar - Common scalar functions (math, string, logical)
  • base_agg - Common aggregates (sum, mean, min, max)
  • base_win - Common window functions

SQL expression building:

  • Use sql_glue() to build SQL with string interpolation
  • Use {x} to interpolate SQL expressions (function arguments)
  • Use {.val x} to interpolate literal R values
  • Use {sql x} to interpolate raw SQL strings

Argument handling:

  • Check arguments with check_bool(), check_unsupported_arg()
  • Convert R types appropriately (e.g., as.integer())
  • Handle optional arguments with defaults

Resources

See also:

  • vignette("translation-function") - Function translation overview
  • vignette("new-backend") - Creating new backends
  • Existing backend files for examples

Checklist

Before completing a SQL translation:

  • Researched SQL syntax in official documentation
  • Created research file in research/{dialect}-{function}.md
  • Added translation to appropriate sql_translator() section
  • Tested translation interactively
  • Added/updated tests
  • Updated backend documentation
  • Ran air format .
  • Verified tests pass

相关技能

寻找 sql-translation 的替代方案 (Alternative) 或可搭配使用的同类 community Skill?探索以下相关开源技能。

查看全部

openclaw-release-maintainer

Logo of openclaw
openclaw

Your own personal AI assistant. Any OS. Any Platform. The lobster way. 🦞

333.8k
0
AI

widget-generator

Logo of f
f

为prompts.chat的信息反馈系统生成可定制的插件小部件

149.6k
0
AI

flags

Logo of vercel
vercel

React 框架

138.4k
0
浏览器

pr-review

Logo of pytorch
pytorch

Python中具有强大GPU加速的张量和动态神经网络

98.6k
0
开发者工具