Supabase PostgreSQL 最佳实践
原名:supabase-postgres-best-practices
用 Supabase 维护的规则设计和优化任意环境中的 PostgreSQL 数据库。
中文 Skills 技能说明
适合表结构、迁移、索引、RLS、慢查询、连接与备份恢复。先读取真实架构和执行计划,再给出分级建议;写 SQL、迁移或恢复前必须备份并确认目标数据库。技能可用于自建 PostgreSQL,不要求 Supabase Cloud;如连接云服务,账号、区域、费用和数据位置由用户确认。
上游能力依据
上游原始适用说明:Postgres best practices maintained by Supabase, for Postgres running anywhere. Load this skill BEFORE writing or changing anything that lives in a Postgres database: creating or altering tables and columns (including choosing column types), schema design, migrations and declarative schema files, RLS policies and the tests that verify them, indexes, triggers, database functions, queues and scheduled jobs (pgcron, pgmq), vector/semantic search (pgvector), and restoring dumps (pgrestore) or importing data. Also load it when diagnosing slow queries, high CPU, timeouts, EXPLAIN plans, connection exhaustion, locking, bloat, or rows visible to the wrong user or tenant. This is not just a performance guide — schema, migration, security, and SQL authoring tasks need these rules too, even for a one-column change or a single query.
上游 SKILL.md 主要章节(保留原文标题):
- When to Apply
- Rule Categories by Priority
- How to Use
- References
使用边界
先确认数据口径、只读或写入权限以及备份方案。查询结果需要说明范围,任何结构或数据变更都应先预览并人工确认。
作者、翻译与许可证
- 原作者
- Supabase 与 supabase/agent-skills contributors
- 中文翻译
- CEOFans翻译
- 许可证
- MIT
- 上游来源
- https://github.com/supabase/agent-skills/tree/8331f910845103c08d51f6ca1d86ebb7d1f745e3/skills/supabase-postgres-best-practices
适用范围
平台:linux、macos、windows;标签:数据与数据库、Supabase PostgreSQL 最佳实践
安全提示
基础静态扫描不等于绝对安全。技能可能调用命令、浏览器、云服务或本地文件,请在最小权限环境中使用,高风险操作必须人工确认。
如发现侵权、许可证或安全问题,可在本页前台提交投诉,管理员复核后可立即下架。