postgresql-code-review

Solid

PostgreSQL-specific code review assistant focusing on PostgreSQL best practices, anti-patterns, and unique quality standards. Covers JSONB operations, array usage, custom types, schema design, function optimization, and PostgreSQL-exclusive security features like Row Level Security (RLS).

Code & Development 34,887 stars 4287 forks Updated today MIT

Install

View on GitHub

Quality Score: 93/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# PostgreSQL Code Review Assistant Expert PostgreSQL code review for ${selection} (or entire project if no selection). Focus on PostgreSQL-specific best practices, anti-patterns, and quality standards that are unique to PostgreSQL. ## ๐ŸŽฏ PostgreSQL-Specific Review Areas ### JSONB Best Practices ```sql -- โŒ BAD: Inefficient JSONB usage SELECT * FROM orders WHERE data->>'status' = 'shipped'; -- No index support -- โœ… GOOD: Indexable JSONB queries CREATE INDEX idx_orders_status ON orders USING gin((data->'status')); SELECT * FROM orders WHERE data @> '{"status": "shipped"}'; -- โŒ BAD: Deep nesting without consideration UPDATE orders SET data = data || '{"shipping":{"tracking":{"number":"123"}}}'; -- โœ… GOOD: Structured JSONB with validation ALTER TABLE orders ADD CONSTRAINT valid_status CHECK (data->>'status' IN ('pending', 'shipped', 'delivered')); ``` ### Array Operations Review ```sql -- โŒ BAD: Inefficient array operations SELECT * FROM products WHERE 'electronics' = ANY(categories); -- No index -- โœ… GOOD: GIN indexed array queries CREATE INDEX idx_products_categories ON products USING gin(categories); SELECT * FROM products WHERE categories @> ARRAY['electronics']; -- โŒ BAD: Array concatenation in loops -- This would be inefficient in a function/procedure -- โœ… GOOD: Bulk array operations UPDATE products SET categories = categories || ARRAY['new_category'] WHERE id IN (SELECT id FROM products WHERE condition); ``` ### PostgreSQL Schema Design Review ```sql -- โŒ BA...

Details

Author
github
Repository
github/awesome-copilot
Created
1 years ago
Last Updated
today
Language
Python
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content โ€” not just same category