Agent skill · software engineering · affaan-m

postgres-patterns

用于查询优化、模式设计、索引和安全性的PostgreSQL数据库模式。基于Supabase最佳实践。

Why this skill is useful

Provides specific PostgreSQL indexing patterns and optimization techniques that the AI wouldn't reliably generate on its own.

What it needs

About 2k tokens when loaded. Last updated 2026-08-06. 238,342 stars on the source repository.

What this skill does

PostgreSQL 模式 PostgreSQL 最佳实践快速参考。如需详细指导,请使用 database-reviewer 智能体。 何时激活 编写 SQL 查询或迁移时 设计数据库模式时 排查慢查询时 实施行级安全性时 设置连接池时 快速参考 索引速查表 查询模式 索引类型 示例 -------------- ------------ --------- WHERE col = value B-tree(默认) CREATE INDEX idx ON t (col) WHERE col > value B-tree CREATE INDEX idx ON t (col) WHERE a = x AND b > y 复合索引 CREATE INDEX idx ON t (a, b) WHERE jsonb @> '{}' GIN CREATE INDEX idx ON t USING gin (col) WHERE tsv @@ query GIN CREATE INDEX idx ON t USING gin (col) 时间序列范围查询 BRIN CREATE INDEX idx ON t USING brin (col) 数据类型快速参考 使用场景 正确类型 避免使用 ---------- ------------- ------- ID bigint int,随机 UUID 字符串 text varchar(255) 时间戳 timestamptz timestamp 货币 numeric(10,2) float 标志位 boolean varchar,int 常见模式 复合索引顺序: 覆盖索引: 部分索引: RLS 策略(优化版): UPSERT: 游标分页: 队列处理: 反模式检测\\ 配置模板 相关 智能体:database-reviewer - 完整的数据库审查工作流 技能:clickhouse-io - ClickHouse 分析模式 技能:backend-patterns - API 和后端模式 基于 Supabase 代理技能(致谢:Supabase 团队)(MIT 许可证)

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills affaan-m/postgres-patterns--aad8be

View the source on GitHub

Browse the @skills marketplace