AGENT SKILL

d1-sql-playground

Use when editing d1-sql-playground. POST /query with { sql }; read-only SELECT against seeded D1 tables (products, experiments); binding DB.

适用职业数据分析师
使用场景后端与接口
License 许可
MIT
最近更新
2026-10-06
Stars
★ 3
Forks
0

01 前言 Front Matter

name
d1-sql-playground
description
Use when editing d1-sql-playground. POST /query with { sql }; read-only SELECT against seeded D1 tables (products, experiments); binding DB.

02 资源文件 7

03 SKILL.md 正文

D1 SQL Playground

  • Routes: POST /query (body { sql }); GET / (app info + allowed tables).
  • Response (query): { columns, rows, rowCount, durationMs }.
  • Bindings: D1 database (DB).
  • Validation: validateSelectSql in src/lib/sql.ts — SELECT only, no semicolons/comments, allowed tables whitelist.
  • Utils: jsonError, jsonSuccess; migrations in migrations/0000_init.sql.

04 同仓库更多 Skills