GitHub CopilotSQLDatabase

SQL GitHub Copilot Instructions

GitHub Copilot instructions for SQL: query patterns, migrations, and database design conventions.

.github/copilot-instructions.md
- Generate parameterized queries; never interpolate user input into SQL
- Apply window functions (ROW_NUMBER, RANK, LAG, LEAD) for analytical queries
- Generate indexes for all JOIN and WHERE conditions in generated queries
- Use CTEs with descriptive names for multi-step analytical queries
- Generate idempotent migrations with IF NOT EXISTS guards
- Apply proper transaction boundaries for multi-statement mutations
- Use EXPLAIN or EXPLAIN ANALYZE to comment on query performance expectations
- Generate soft delete columns (deleted_at TIMESTAMPTZ) instead of hard deletes

How to use with GitHub Copilot

Create `.github/copilot-instructions.md` in your repository. GitHub Copilot uses these to customize suggestions across your whole repo.

#sql#database#copilot#github#coding-rules

Related Rules