
database-query
Natural language database queries across multiple engines with built-in query optimization.
- version
- 1.0.0
- GitHub stars
- 38
What it does
- Adds natural language querying for multiple database engines, with query optimization applied to generated SQL
- Covers schema-aware query generation so requests can be written in plain English instead of raw SQL
- Designed for developers who want to query their stack's databases without writing SQL by hand
Natural language database queries with multi-database support and optimization
Add marketplace
/plugin marketplace add glincker/claude-code-marketplaceRun it inside Claude Code once, then install the plugin below.
Install
/plugin install database-query@glincker-marketplaceRun it inside Claude Code after adding the marketplace.
Files
Discovered from sourceDatabase Query (Natural Language)
⚡ UNIQUE FEATURE: Query any database using natural language - automatically generates optimized SQL/NoSQL queries, explains query plans, suggests indexes, and visualizes results. Supports PostgreSQL, MySQL, MongoDB, SQLite, and more.
What This Skill Does
Transform natural language into optimized database queries:
- Natural language to SQL: "Show me users who signed up last month" →
SELECT * FROM users WHERE created_at >= NOW() - INTERVAL '1 month' - Multi-database support: PostgreSQL, MySQL, MongoDB, SQLite, Redis
- Query optimization: Analyzes queries and suggests improvements
- Index suggestions: Recommends indexes for slow queries
- Visual results: Formats query results as tables, charts, JSON
- Query explanation: EXPLAIN ANALYZE with human-readable insights
- Safe mode: Read-only by default with confirmation for writes
- Schema discovery: Auto-learns database structure
Why This Is Unique
First Claude Code skill that:
- Understands intent: Translates vague requests to precise queries
- Cross-database compatible: Same natural language works across SQL/NoSQL
- Performance-aware: Automatically optimizes and suggests indexes
- Safety-first: Prevents destructive operations without confirmation
- Learning mode: Improves by understanding your schema
Instructions
Phase 1: Database Connection & Discovery
-
Identify Database:
Ask user: - Database type (PostgreSQL, MySQL, MongoDB, SQLite, etc.) - Connection method (local, remote, Docker, MCP server) - Connection string or credentials -
Test Connection:
# PostgreSQL psql -h localhost -U user -d database -c "SELECT version();" # MySQL mysql -h localhost -u user -p database -e "SELECT VERSION();" # MongoDB mongosh "mongodb://localhost:27017/database" --eval "db.version()" # SQLite sqlite3 database.db "SELECT sqlite_version();" -
Discover Schema:
# PostgreSQL: Get all tables and columns psql -d database -c "\dt" psql -d database -c "\d+ table_name" # MySQL: Show database structure mysql database -e "SHOW TABLES;" mysql database -e "DESCRIBE table_name;" # MongoDB: List collections and sample documents mongosh database --eval "db.getCollectionNames()" mongosh database --eval "db.collection.findOne()" -
Build Schema Cache:
- Store table/collection names
- Store column names and types
- Store relationships (foreign keys)
- Cache common queries
Phase 2: Natural Language to Query Translation
When user makes a request:
-
Parse Intent:
Analyze the request: - Action: SELECT, INSERT, UPDATE, DELETE, aggregation - Entities: Which tables/collections - Conditions: WHERE clauses - Aggregations: COUNT, SUM, AVG, GROUP BY - Sorting: ORDER BY - Limits: TOP N, pagination -
Generate Query:
Example 1: "Show me all active users"
-- PostgreSQL/MySQL SELECT * FROM users WHERE status = 'active';Example 2: "Count orders by status for last 7 days"
SELECT status, COUNT(*) as count FROM orders WHERE created_at >= NOW() - INTERVAL '7 days' GROUP BY status ORDER BY count DESC;Example 3: "Find top 10 customers by revenue"
SELECT c.name, c.email, SUM(o.total) as revenue FROM customers c JOIN orders o ON c.id = o.customer_id GROUP BY c.id, c.name, c.email ORDER BY revenue DESC LIMIT 10;Example 4: MongoDB aggregation
db.orders.aggregate([ { $match: { status: "completed" } }, { $group: { _id: "$customer_id", total: { $sum: "$amount" } }}, { $sort: { total: -1 } }, { $limit: 10 } ]) -
Validate Query:
- Check table/column names exist
- Verify data types match
- Ensure joins are valid
- Detect potentially dangerous operations
Phase 3: Query Optimization
Before execution:
-
Analyze Query Plan:
-- PostgreSQL EXPLAIN ANALYZE SELECT * FROM users WHERE email LIKE '%@example.com'; -
Suggest Optimizations:
If sequential scan detected: - "This query is scanning all rows. Consider adding an index:" - CREATE INDEX idx_users_email ON users(email); If N+1 query pattern: - "Use JOIN instead of multiple queries" - Show optimized version If missing WHERE clause: - "This will return all rows. Add filters or LIMIT?" -
Rewrite for Performance:
-- Before (slow) SELECT * FROM users WHERE LOWER(email) = 'user@example.com'; -- After (fast - uses index) SELECT * FROM users WHERE email = 'user@example.com';
Phase 4: Safe Execution
-
Determine Query Type:
- Read-only (SELECT): Execute immediately
- Write (INSERT, UPDATE, DELETE): Ask confirmation
- DDL (CREATE, DROP, ALTER): Require explicit confirmation
-
Confirmation for Writes:
⚠️ This query will modify data: UPDATE users SET status = 'inactive' WHERE last_login < '2024-01-01' Estimated affected rows: 1,247 Proceed? [yes/no] -
Transaction Support:
BEGIN; -- Execute query -- Show results -- Ask: COMMIT or ROLLBACK?
Phase 5: Results Formatting
-
Table Format (default):
┌────┬─────────────┬──────────────────────┬──────────┐ │ id │ name │ email │ status │ ├────┼─────────────┼──────────────────────┼──────────┤ │ 1 │ John Doe │ john@example.com │ active │ │ 2 │ Jane Smith │ jane@example.com │ active │ └────┴─────────────┴──────────────────────┴──────────┘ 2 rows returned in 0.023s -
Chart Format (for aggregations):
Orders by Status: pending ████████████░░░░░░░░ 62 completed ████████████████████ 128 cancelled ████░░░░░░░░░░░░░░░░ 15 -
JSON Format (for APIs):
{ "query": "SELECT * FROM users LIMIT 2", "execution_time": "0.023s", "row_count": 2, "results": [ {"id": 1, "name": "John Doe", ...}, {"id": 2, "name": "Jane Smith", ...} ] } -
Export Options:
- CSV file
- JSON file
- Markdown table
- Copy to clipboard
Examples
Example 1: Simple Query
User: "Show me recent users"
Skill:
- Interprets "recent" as last 7 days
- Generates query:
SELECT * FROM users WHERE created_at >= NOW() - INTERVAL '7 days' ORDER BY created_at DESC; - Executes and displays results
- Suggests: "Want to filter by status or role?"
Example 2: Complex Aggregation
User: "Which products had the most revenue last quarter?"
Skill:
- Determines tables: products, orders, order_items
- Calculates "last quarter" date range
- Generates optimized query:
SELECT p.id, p.name, SUM(oi.quantity * oi.price) as revenue, COUNT(DISTINCT o.id) as order_count FROM products p JOIN order_items oi ON p.id = oi.product_id JOIN orders o ON oi.order_id = o.id WHERE o.created_at >= DATE_TRUNC('quarter', NOW() - INTERVAL '3 months') AND o.created_at < DATE_TRUNC('quarter', NOW()) AND o.status = 'completed' GROUP BY p.id, p.name ORDER BY revenue DESC LIMIT 10; - Shows results with chart
- Offers to export
Example 3: Performance Investigation
User: "Why is this query slow?"
SELECT * FROM orders WHERE customer_name LIKE 'John%';
Skill:
- Runs EXPLAIN ANALYZE
- Detects: Sequential scan on 10M rows
- Suggests:
⚠️ Performance Issue Detected: Problem: Full table scan (10,485,234 rows) Solution: Add an index on customer_name CREATE INDEX idx_orders_customer_name ON orders(customer_name); Expected improvement: 10,485,234 rows → ~42 rows Estimated speed-up: 10,000x faster Would you like me to create this index?
Configuration
Create .database-query-config.yml:
databases:
- name: production
type: postgresql
host: localhost
port: 5432
database: myapp
user: readonly_user
ssl: true
read_only: true
- name: analytics
type: mongodb
uri: mongodb://localhost:27017/analytics
- name: cache
type: redis
host: localhost
port: 6379
defaults:
max_rows: 1000
timeout: 30s
explain_threshold: 1s # Auto-explain queries slower than 1s
auto_optimize: true
safety:
require_confirmation_for_writes: true
prevent_drop_table: true
max_affected_rows: 10000
Tool Requirements
- Bash: Execute database CLI commands
- Read: Read config files and schema cache
- Write: Save query results and reports
- Task: Launch optimization analyzer agent
Integration with MCP
Connect to MCP database servers:
# Using PostgreSQL MCP server
mcp_servers:
- name: postgres
command: postgres-mcp
args:
- --connection-string
- postgresql://user:pass@localhost/db
Advanced Features
1. Query History & Favorites
# Save favorite queries
claude db save "monthly_revenue" "SELECT..."
# Run saved query
claude db run monthly_revenue
2. Query Templates
-- Template: user_search
SELECT * FROM users
WHERE {{field}} = {{value}}
AND status = 'active';
3. Data Migration Helper
# Generate migration between databases
claude db migrate --from postgres://... --to mysql://...
4. Schema Diff
# Compare two databases
claude db diff production staging
Best Practices
- Start with schema: Let skill discover your database first
- Use read-only mode: For production databases
- Review before writes: Always check UPDATE/DELETE affects
- Monitor performance: Pay attention to optimization suggestions
- Save common queries: Build a library of frequently-used queries
- Use transactions: For multi-step operations
Limitations
- Maximum 10,000 rows displayed (configurable)
- Query timeout: 30 seconds (configurable)
- Write operations require confirmation
- Some database-specific features may not translate
- Complex stored procedures not supported
Security
- Never stores credentials in plain text
- Read-only mode by default
- SQL injection prevention
- Confirms destructive operations
- Audit logging available
Related Skills
- api-connector - Query APIs with natural language
- data-analyzer - Analyze query results
- schema-designer - Design database schemas
Changelog
Version 1.0.0 (2025-01-13)
- Initial release
- PostgreSQL, MySQL, MongoDB, SQLite support
- Natural language query translation
- Query optimization and EXPLAIN
- Multiple output formats
- Safe mode with confirmations
Contributing
Help expand database support:
- Add new database types (CockroachDB, DynamoDB, Cassandra)
- Improve query optimization
- Add more visualization options
- Create query templates
License
Apache License 2.0 - See LICENSE
Author
GLINCKER Team
- GitHub: @GLINCKER
- Repository: claude-code-marketplace
🌟 The most advanced natural language database query skill available!
From the glincker/claude-code-marketplace README
GLINCKER Claude Code Marketplace
Community-Driven Agent Marketplace - A comprehensive collection of specialized agents, automation workflows, and developer productivity tools
What GLINCKER Offers
A comprehensive marketplace of production-ready agents and tools designed to solve real developer pain points. Built by the community, for the community.
| Category | What We Provide | How It Helps |
|---|---|---|
| Multi-Agent Coordination | 5 parallel agents for code review | Comprehensive analysis from security, performance, testing, architecture, and style perspectives |
| Workflow Orchestration | YAML-based agent chaining | Automate complex pipelines with conditional logic and parallel execution |
| Quick Access | 7 slash commands | Instant access to common development tasks |
| Integrations | Database queries + 100+ APIs | Natural language interface to your entire stack |
| Infrastructure | Docker, Kubernetes, CI/CD | Production-ready configurations and best practices |
| Full SDLC Coverage | 23+ specialized agents | End-to-end support from development to deployment |
Why Choose GLINCKER
Comprehensive: 23+ specialized agents covering every stage of development Collaborative: Multi-agent coordination for complex tasks Automated: Workflow orchestration to chain agents together Production-Ready: Battle-tested configurations and best practices Open Source: Community-driven with transparent development Extensible: Easy to add your own agents and workflows
We're always improving - contributions welcome! See our Contributing Guide to help make this marketplace even better.
Architecture
Multi-Agent Code Review System
graph TD
A[Pull Request] --> B[PR Reviewer Skill]
B --> C[Security Agent]
B --> D[Performance Agent]
B --> E[Testing Agent]
B --> F[Architecture Agent]
B --> G[Style Agent]
C --> H[Synthesizer]
D --> H
E --> H
F --> H
G --> H
H --> I[Comprehensive Review Report]
I --> J[Auto-Generated Fixes]
Workflow Composition Framework
┌─────────────────────────────────────────────────────────────┐
│ Workflow Composer │
├─────────────────────────────────────────────────────────────┤
│ │
│ Step 1: Code Quality Checks (Parallel) │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │ Linter │ │ Security │ │ Tests │ │
│ └────┬─────┘ └────┬─────┘ └────┬─────┘ │
│ └─────────────┼─────────────┘ │
│ ↓ │
│ Step 2: Conditional Logic │
│ ┌─────────────────────────────────────┐ │
│ │ IF all_passed THEN proceed │ │
│ │ ELSE notify and exit │ │
│ └────────────────┬────────────────────┘ │
│ ↓ │
│ Step 3: Deployment │
│ ┌─────────────────────────────────────┐ │
│ │ Deploy with retry (max 3 attempts) │ │
│ └─────────────────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────┘
Quick Start
1. Install Marketplace
/plugin marketplace add https://github.com/GLINCKER/claude-code-marketplace
2. Install Essential Agents
# Core development agents
/plugin install pr-reviewer@glincker-marketplace
/plugin install security-scanner@glincker-marketplace
/plugin install docker-wizard@glincker-marketplace
# Or install all
/plugin marketplace install glincker-marketplace
3. Use Slash Commands
/review # Multi-agent code review (5 agents)
/test # Generate unit tests
/security-scan # OWASP Top 10 audit
/docker-setup # Generate Docker config
/k8s-setup # Generate Kubernetes manifests
/deploy staging # Orchestrated deployment
/workflow # Create automated workflow
4. Natural Language Commands
# Database queries
"Show me users who signed up last month with revenue > $100"
# API integrations
"Send Slack message to #engineering: Deployment complete"
# Code migration
"Migrate this React component from class to hooks"
# Infrastructure
"Generate production-ready K8s manifests with autoscaling"
# Workflows
"Create workflow: test → security scan → deploy if all pass"
Featured Skills
Autonomous PR Reviewer
Location: skills/devops/pr-reviewer/
Multi-agent code review system with 5 specialized agents working in parallel.
- Security Agent: Vulnerability scanning, OWASP compliance
- Performance Agent: Bottleneck detection, optimization suggestions
- Testing Agent: Coverage analysis, test case generation
- Architecture Agent: Design pattern review, SOLID principles
- Style Agent: Code style, documentation quality
Unique value: 5x more thorough than single-agent reviews, generates actionable fixes.
Workflow Composer
Location: skills/automation/workflow-composer/
First skill composition framework for Claude Code. Chain multiple skills with YAML configuration.
steps:
- name: quality-checks
parallel:
- skill: security-scan
- skill: test-runner
- skill: linter
- name: deploy
when: ${steps.quality-checks.all_passed}
skill: deploy-orchestrator
retry:
max_attempts: 3
backoff: exponential
Unique value: Build complex automation pipelines without coding.
Database Query (Natural Language)
Location: skills/integrations/database-query/
Query any database using natural language with automatic optimization.
-- Input: "Show me users who signed up last month"
-- Generated:
SELECT * FROM users
WHERE created_at >= NOW() - INTERVAL '1 month'
ORDER BY created_at DESC;
-- Includes: Query optimization, index suggestions, EXPLAIN ANALYZE
Supported: PostgreSQL, MySQL, MongoDB, SQLite, Redis
Unique value: Only skill with query optimization and index suggestions.
Code Migrator
Location: skills/development/code-migrator/
Automated legacy code modernization with risk assessment.
Supported migrations:
- Python 2 to Python 3
- JavaScript to TypeScript
- React Classes to Hooks
- Callbacks to Async/Await
- Framework upgrades (Django, Rails, Express)
Unique value: AI-powered risk assessment + automated test generation.
API Connector
Location: skills/integrations/api-connector/
Natural language interface to 100+ popular APIs.
Supported services:
- Development: GitHub, GitLab, Linear, Jira
- Communication: Slack, Discord, Twilio
- Payments: Stripe, PayPal, Square
- Cloud: AWS, Google Cloud, Azure
- AI: OpenAI, Anthropic, Hugging Face
- And 90+ more
Unique value: Handles authentication (OAuth, JWT), generates integration code.
Essential Skills
- README Generator (
skills/documentation/readme-generator/): Analyze project structure and generate comprehensive documentation - Unit Test Generator (
skills/testing/unit-test-generator/): Create tests for multiple languages with coverage analysis
Comparison
| Feature | GLINCKER | Other Marketplaces |
|---|---|---|
| Multi-Agent Skills | 5 parallel agents | None |
| Workflow Orchestration | YAML-based | None |
| API Integrations | 100+ services | Few (5-10) |
| Database Query | With optimization | Basic/None |
| Code Migration | AI + risk assessment | None |
| Code Generation | Multi-language | Limited |
Use Cases
Startup: "Set up CI/CD, generate tests, create documentation" → Automated workflow handles everything
Enterprise: "Migrate Python 2 monolith to Python 3 microservices" → Risk-assessed migration with automated testing
Developer: "Review code, optimize, and deploy" → Multi-agent review with automated deployment
Skill Categories
skills/
├── development/ # Code migration, refactoring, architecture
├── devops/ # PR review, CI/CD, deployment
├── testing/ # Unit tests, integration tests, coverage
├── documentation/ # README, API docs, changelogs
├── integrations/ # APIs, databases, external services
├── automation/ # Workflows, task automation
├── data-science/ # Data analysis, visualization
└── security/ # Audits, vulnerability scanning
Skill Structure
skills/category/your-skill/
├── SKILL.md # Required: Skill definition with YAML frontmatter
├── scripts/ # Optional: Helper scripts
└── templates/ # Optional: File templates
Minimal SKILL.md
---
name: your-skill
description: What your skill does
allowed-tools: ["Read", "Write"]
version: 1.0.0
author: Your Name
---
# Instructions
Clear instructions for Claude on executing this skill.
## Examples
Concrete usage examples.
Contributing
- Fork repository
- Create skill in appropriate category
- Follow Skill Template
- Submit pull request
- Pass community review
Resources:
- Contributing Guide - Detailed instructions
- Quick Start - Fast-track guide
- Unique Features - What makes us different
Quality Standards
All skills must have:
- Clear documentation with examples
- Minimal tool permissions (principle of least privilege)
- Security-conscious implementation
- Error handling for edge cases
- Automated testing where applicable
Safety
Skills execute code on your system. Before installing:
- Review source code
- Check author reputation
- Understand required permissions
- Only install from trusted sources
Community
- Discussions: Ask questions, share workflows
- Issues: Report bugs, request features
- Contributing: Contribution guidelines
Resources
License
Apache License 2.0 - See LICENSE
Acknowledgments
Built on:
- Anthropic's Skills - Foundation
- Claude Code community - Inspiration
- Open source contributors - Innovation
Made with Claude Code by the GLINCKER community
Details
- Marketplace
- glincker/claude-code-marketplace
- Source
- skills/integrations/database-query
- Category
- Community
- Keywords
- database, sql, query, natural-language
- Listed since
- Apr 7, 2026
More from glincker/claude-code-marketplace
All 24- deployment-managerv1.0.0
- devops-specialistv1.0.0
- docker-wizardv1.0.0
- environment-managerv1.0.0
- frontend-specialistv1.0.0
- git-hooks-managerv1.0.0
- hello-worldv1.0.0
- k8s-generatorv1.0.0
- performance-optimizerv1.0.0
- pr-reviewerv1.0.0
- qa-engineerv1.0.0
- readme-generatorv1.0.0
- security-scannerv1.0.0
- tech-writerv1.0.0
- unit-test-generatorv1.0.0
- workflow-composerv1.0.0
- aident-skillv0.4.0
- api-connectorv1.0.0
- backend-architectv1.0.0
- changelog-generatorv1.0.0
- cicd-pipeline-builderv1.0.0
- code-migratorv1.0.0
- data-engineerv1.0.0
Similar to database-query
More Databases
database-optimizerPluginrohitg00/awesome-claude-code-toolkit2.8K starsDatabase query optimization with index recommendations and EXPLAIN analysis
sqlPluginmiles990/claude-software-skills26 starsSQL patterns for database querying and design
do-databasesPluginTheBushidoCollective/han201 starsDatabase engineering agents providing expertise in schema design, query optimization, and reliability
databricks-skillsPluginAltimateAI/data-engineering-skills135 starsSkills for Databricks SQL query optimization
database-toolkitPluginarmanzeroeight/fastagent-plugins29 starsDatabase design toolkit for schema modeling, query optimization, and indexing strategies. Includes database architect agent for strategic database decisions.
sql-queriesSkillphuryn/pm-skills3K installsNatural-language to SQL generator that reads schema files and targets BigQuery, PostgreSQL, MySQL, and other dialects.