database-query

database-query is a skill for Claude Code, Codex from glincker/claude-code-marketplace. It costs 19 tokens per session (3,145 once invoked), scanned A, original, Apache-2.0.

A natural-language database query tool that turns plain-English questions into SQL or NoSQL queries for databases such as PostgreSQL, MySQL, MongoDB, SQLite, and Redis. It can also explain query plans and format results as tables, charts, or JSON.

In plain words
What is it for?
It is for finding data, discovering schemas, optimizing queries, suggesting indexes, explaining execution plans, and running read-only queries by default.
Why use it?
It helps people query unfamiliar database structures without manually writing every query, while also highlighting ways to improve slow queries.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/glincker/claude-code-marketplace/database-query
Any agent
npx skills add glincker/claude-code-marketplace --skill database-query
Clone the repo
git clone --depth 1 https://github.com/glincker/claude-code-marketplace

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for database-query

README.md
[![agentmods](https://agentmods.dev/badge/skills/glincker/claude-code-marketplace/database-query.svg)](https://agentmods.dev/skills/glincker/claude-code-marketplace/database-query)
Your own site
<a href="https://agentmods.dev/skills/glincker/claude-code-marketplace/database-query"><img src="https://agentmods.dev/badge/skills/glincker/claude-code-marketplace/database-query.svg" alt="Measured on agentmods" height="20"></a>
Per session 19 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,145 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00019 $0.03145
Opus 5 $0.00010 $0.01572
Sonnet 5 $0.00004 $0.00629
Haiku 4.5 $0.00002 $0.00314

Measured 4d ago against content hash 2a4502c1b901, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

database-query scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/integrations/database-query/SKILL.md · 475 lines

How it starts

The opening of the file, as written. The whole thing — 475 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Database 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

  1. Identify Database:

    Ask user:
    - Database type (PostgreSQL, MySQL, MongoDB, SQLite, etc.)
    - Connection method (local, remote, Docker, MCP server)
    - Connection string or credentials
    
  2. 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();"
    
  3. 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()"
    

Read the full file on GitHub · 475 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 475 lines · 19 tokens per session scan A 2a4502c1b901

Subscribe to this mod's changes

database-query is a skill published in the GitHub repository glincker/claude-code-marketplace (36 stars, last pushed 9mo ago), licensed Apache-2.0. It adds 19 tokens to every session and 3,145 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

database-query

Generate, optimize, and explain SQL queries - supports SQLite, PostgreSQL, MySQL with schema introspection, migration generation, and query performance analysis.

chainlesschain/chainlesschain · 32 tokens

graphjin-eval

Create, extend, run, baseline, and diagnose GraphJin agent evaluations through the graphjin eval CLI.

dosco/graphjin · 27 tokens

graphjin-env

Use when setting up a training or evaluation loop against a GraphJin agent environment — running the container, reading /health, driving episodes hosted or step-by-step or with your own agent over MCP, splitting train from eval, exporting trajectories, and deciding whether two rewards can be compared.

dosco/graphjin · 61 tokens

graphjin-env-workflows

Use when running GraphJin's own environment and evaluation workflows in this repository — generating a suite, cloning or minting a world, authoring tasks, serving graded episodes, sampling, exporting trajectories, publishing a benchmark run — or when changing code those workflows depend on.

dosco/graphjin · 60 tokens

add-graphjin-database

Use when adding a new GraphJin database, warehouse, or CQL/NoSQL backend; building a simulator because no live service is available; wiring a dialect, discovery, tests, scripts, README/CONFIG/FEATURES, or website database support surfaces.

dosco/graphjin · 60 tokens

Database Schema Reviewer

Reviews database schemas for normalization issues, missing indexes, naming inconsistencies, and scalability risks.

Notysoty/openagentskills · 22 tokens