A web application that analyzes SQL queries for efficiency and performance issues using GitHub Copilot SDK.
- Split-pane interface inspired by jsonschemavalidator.net
- AI-powered analysis using GitHub Copilot SDK
- Real-time feedback on query efficiency with scoring (0-100)
- Detailed recommendations for improving SQL performance
- Pre-baked worst practice queries accessible via burger menu
- Beautiful UI with color-coded severity levels
- Node.js (v18 or higher)
- GitHub Copilot CLI - Install with:
npm install -g @github/copilot
- GitHub Copilot subscription - Required for using the Copilot SDK
-
Clone the repository:
git clone https://github.com/MG-Octodemo/SQL-Reviewer.git cd SQL-Reviewer -
Install dependencies:
npm install
-
Authenticate with GitHub CLI:
gh auth login
-
Start the server:
npm start
-
Open your browser and navigate to:
http://localhost:3000 -
Enter a SQL query in the left pane or use the burger menu (☰) to select a pre-baked worst practice query
-
Click "Analyze Query" to get AI-powered efficiency analysis
You can configure the application using environment variables:
PORT- Server port (default: 3000)COPILOT_TIMEOUT- Timeout for Copilot SDK analysis in milliseconds (default: 30000)
The application uses the GitHub Copilot SDK to analyze SQL queries for common performance issues:
- SELECT * usage
- Missing WHERE clauses (full table scans)
- Functions on indexed columns
- Implicit type conversions
- Multiple OR conditions
- Subqueries in SELECT clause
- NOT IN with subqueries
- Leading wildcards in LIKE patterns
- Missing JOIN conditions
- Cartesian products
Each query receives a score from 0-100, with detailed explanations and recommendations for improvement.
- Frontend: HTML, CSS, JavaScript
- Backend: Node.js + Express
- AI Engine: GitHub Copilot SDK (GPT-4o)
- Communication: REST API
For development with auto-restart on file changes:
npm run dev-
POST /api/analyze- Analyze a SQL query{ "query": "SELECT * FROM users" } -
GET /api/health- Check server health
- https://github.com/jamesmontemagno/hello-copilot-sdk-dotnet
- https://github.com/jamesmontemagno/podcast-metadata-generator
- https://github.com/chrisreddington/flight-school
- https://github.com/patniko/github-copilot-browser
- https://github.com/patniko/copilot-tasks
- Many more, go start yours https://github.com/github/copilot-sdk
MIT