首页/ AI 技能 / @skilllib/skill-2117939930272412181
Skill站外收录 @skilllib/skill-2117939930272412181

srtd-cli

支持 Supabase 项目中 SQL 模板的迭代式开发,通过实时监听、自动应用与构建迁移文件,实现函数、视图、策略及触发器的本地快速验证与版本化部署,兼顾依赖管理与状态隔离。

0.0 (0) 24 次安装 原作者 编程导航
收录于 2026-01-22
软件开发 AI 技能

Skills.MD

# SRTD - Iterative SQL Template Development ## Workflow Start watch in background immediately: ```bash srtd watch --json ``` Use `run_in_background: true`. Monitor with `TaskOutput` for events: `templateApplied` (success), `templateError` (check `errorMessage`/`errorHint`). ## Templates Location: `supabase/migrations-templates/*.sql`. Must be idempotent. **Idempotency patterns:** - Functions/Views: `CREATE OR REPLACE` (use `DROP` only when changing signature) - Policies: `DROP POLICY IF EXISTS` then `CREATE POLICY` (not replaceable) - Triggers: Drop BOTH trigger AND function first **Dependencies:** `-- @depends-on: other.sql` at top **WIP:** `.wip.sql` suffix → applies locally, never builds ## Commands ```bash srtd apply [--force] [--json] # Apply to local DB (use instead of watch for one-off) srtd build [--bundle] # Generate migration FILES only (does NOT apply to DB) srtd clear --reset # Reset state if confused ``` ## State - `.buildlog.json` → commit (tracks built migrations) - `.buildlog.local.json` → gitignored (local DB state)

评论 0

还没有评论,来抢沙发。