database-query-and-export

database-query-and-export is a skill for Claude Code, Codex from besoeasy/open-skills. It costs 58 tokens per session (3,141 once invoked), scanned B, original, MIT.

A workflow for querying SQLite, PostgreSQL, and MySQL databases and exporting the results to files such as CSV or JSON.

In plain words
What is it for?
Use it to extract data for reports or analysis, create backups, support migrations, and build database monitoring workflows.
Why use it?
It removes the need to write separate database commands and export steps for common data tasks.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to extract data for reports or analysis, create backups, support migrations, and build database monitoring workflows.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/besoeasy/open-skills/database-query-and-export
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.

Any agent
npx skills add besoeasy/open-skills --skill database-query-and-export
Clone the repo
git clone --depth 1 https://github.com/besoeasy/open-skills

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-and-export

README.md
[![agentmods](https://agentmods.dev/badge/skills/besoeasy/open-skills/database-query-and-export/github.svg)](https://agentmods.dev/skills/besoeasy/open-skills/database-query-and-export)
Your own site
<a href="https://agentmods.dev/skills/besoeasy/open-skills/database-query-and-export"><img src="https://agentmods.dev/badge/skills/besoeasy/open-skills/database-query-and-export/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for database-query-and-export

Your own site · 80×15
<a href="https://agentmods.dev/skills/besoeasy/open-skills/database-query-and-export"><img src="https://agentmods.dev/badge/skills/besoeasy/open-skills/database-query-and-export.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 58 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,141 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Privilege Escalation · line 28
    Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
    Fix: Avoid sudo/root unless strictly required. Prefer least-privilege patterns. If elevation is needed, document the justification and scope.
How audits are shown
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.1 $0.00058 $0.03141
Opus 5.5 $0.00023 $0.01256
Sonnet 5.5 $0.00012 $0.00628
Haiku 4.5 $0.00006 $0.00314

Measured 3mo ago against content hash 4dc9bf6f6c9e, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade B, and why

database-query-and-export scanned grade B with 1 finding 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 3mo 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.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

sudo apt-get install -y sqlite3 postgresql-client mysql-client
skills/database-query-and-export/SKILL.md · 438 lines

How it starts

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

Database Query and Export

Query relational databases (SQLite, PostgreSQL, MySQL) and export results to CSV, JSON, or other formats. Essential for data extraction, reporting, backup automation, and analytics pipelines.

When to use

  • Use case 1: When the user asks to query a database and export results
  • Use case 2: When you need to extract data for analysis or reporting
  • Use case 3: For backup and data migration workflows
  • Use case 4: When building automated database monitoring and alerts

Required tools / APIs

  • SQLite — Lightweight file-based database (often pre-installed)
  • PostgreSQL client — For PostgreSQL databases
  • MySQL client — For MySQL/MariaDB databases
  • No external API required

Install options:

# Ubuntu/Debian
sudo apt-get install -y sqlite3 postgresql-client mysql-client

# macOS
brew install sqlite3 postgresql mysql-client

# Node.js (database drivers)
npm install better-sqlite3  # SQLite
npm install pg              # PostgreSQL
npm install mysql2          # MySQL

Skills

query_sqlite_to_json

Query SQLite database and export to JSON format.

# Basic query to JSON
sqlite3 database.db "SELECT * FROM users LIMIT 10;" -json

# With pretty formatting using jq
sqlite3 database.db "SELECT * FROM users WHERE active=1;" -json | jq '.'

# Export entire table to JSON file
sqlite3 database.db "SELECT * FROM orders;" -json > orders.json

# Query with WHERE clause
sqlite3 database.db "SELECT id, name, email FROM users WHERE created_at > '2024-01-01';" -json

Node.js:

const Database = require('better-sqlite3');

function querySQLiteToJSON(dbPath, query) {
  const db = new Database(dbPath, { readonly: true });
  const rows = db.prepare(query).all();
  db.close();
  return rows;
}

// Usage
// const users = querySQLiteToJSON('./database.db', 'SELECT * FROM users LIMIT 10');
// console.log(JSON.stringify(users, null, 2));

query_sqlite_to_csv

Query SQLite database and export to CSV format.

Read the full file on GitHub · 438 lines

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. 3mo ago First seen · 438 lines · 58 tokens per session scan B 4dc9bf6f6c9e

Subscribe to this mod's changes

database-query-and-export is a skill published in the GitHub repository besoeasy/open-skills (132 stars, last pushed 2mo ago), licensed MIT. It adds 58 tokens to every session and 3,141 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it B with 1 finding (asks for root). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

database-query-and-export compared with skills from other repositories

database-query-and-export next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
database-query-and-exportbesoeasy/open-skillsSkill1322mo agoMITB58Claude Code, Codex
obsidian-baseskepano/obsidian-skillsSkill55k5d agoMITA63Claude Code
kotlin-exposed-patternshashgraph-online/awesome-codex-pluginsSkill1.6kyesterdayApache-2.0A36Claude Code, Codex
clickhouse-iohashgraph-online/awesome-codex-pluginsSkill1.6kyesterdayApache-2.0A26Claude Code, Codex
moai-domain-databasemodu-ai/moai-adkSkill1.3ktodayApache-2.0A64Claude Code
svc-databases0ld13rr/pentestcodeSkill1.3kyesterdayMITA64Claude Code, Codex
moai-platform-database-cloudmodu-ai/moai-adkSkill1.3ktodayApache-2.0A51Claude Code