sql-database-assistant

Generate SQL queries and analyze execution plans across PostgreSQL, MySQL, SQLite, and SQL Server.

Updated Nov 3, 2016
One-click install
npx skills add https://github.com/xleliberty/mydotfiles --skill sql-database-assistant-xleliberty
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sql-database-assistant
Source: https://github.com/xleliberty/mydotfiles/tree/main/.config/.claude/plugins/cache/claude-code-skills/engineering-advanced-skills/2.1.2/sql-database-assistant
Command: npx skills add https://github.com/xleliberty/mydotfiles --skill sql-database-assistant-xleliberty

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This skill bridges the gap between application code and database engines, solving the complexity of writing performant SQL, managing schema migrations, and debugging database bottlenecks.

Core Features & Use Cases

  • Natural Language to SQL: Translate complex business requirements into optimized, dialect-aware SQL queries.
  • Performance Optimization: Analyze EXPLAIN plans, identify N+1 patterns, and receive actionable index recommendations.
  • Migration Management: Generate safe, reversible migration scripts for schema changes across PostgreSQL, MySQL, SQLite, and SQL Server.
  • Use Case: When you need to optimize a slow-running query or generate a zero-downtime migration for a production table, this skill provides the exact SQL patterns and safety checks required.

Quick Start

Use the sql-database-assistant skill to analyze the performance of the provided query and suggest missing indexes for the orders table.

Frequently Asked Questions about sql-database-assistant

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I optimize slow SQL queries and analyze EXPLAIN plans?

SQL query optimization involves analyzing EXPLAIN plans to detect N+1 patterns and providing actionable index recommendations to resolve slow-running database bottlenecks.

Can I generate reversible database migrations for PostgreSQL and MySQL?

Yes, you can generate safe, reversible migration scripts for schema changes across PostgreSQL, MySQL, SQLite, and SQL Server, including zero-downtime migrations for production tables.

What is the best way to translate natural language business requirements into SQL?

The best way to translate business requirements into SQL is using natural language conversion that generates optimized, dialect-aware queries specific to your target relational database engine.

Does this SQL optimization approach work with different database dialects?

Yes, this SQL optimization approach supports dialect-specific query patterns across multiple relational databases, including PostgreSQL, MySQL, SQLite, and SQL Server for schema introspection and analysis.

How do I detect N+1 query patterns in my application code?

Detecting N+1 query patterns involves analyzing the interaction between application code and database engines, using schema introspection and static analysis of SQL execution plans to identify redundant queries.