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 $0.00029 $0.01571
Sonnet 5 $0.00012 $0.00628
Haiku 4.5 $0.00006 $0.00314

Measured 9d ago against content hash 4dc9bf6f6c9e, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, 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 9d 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. 9d 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 4d ago), licensed MIT. It adds 58 tokens to every session and 3,141 once invoked, about $0.0003 per session on Opus 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

Other skills, from other repositories

obsidian-bases

Create and edit Obsidian Bases (.base files) with views, filters, formulas, and summaries. Use when working with .base files, creating database-like views of notes, or when the user mentions Bases, table views, card views, filters, or formulas in Obsidian.

kepano/obsidian-skills · 63 tokens

kotlin-exposed-patterns

JetBrains Exposed ORM patterns including DSL queries, DAO pattern, transactions, HikariCP connection pooling, Flyway migrations, and repository pattern.

hashgraph-online/awesome-codex-plugins · 36 tokens

memstack-development-migration-planner

Use this skill when the user says 'migration', 'schema change', 'database migration', 'alter table', 'add column', 'change type', 'rollback plan', or needs safe database schema evolution with zero-downtime strategies. Do NOT use for initial database design (use database-architect) or code refactoring.

cwinvestments/memstack · 73 tokens

moai-platform-database-cloud

Cloud database platform specialist covering Neon (serverless PostgreSQL), Supabase (PostgreSQL 16 with real-time), and Firebase Firestore (NoSQL with offline sync). Use when choosing or setting up cloud databases.

modu-ai/moai-adk · 51 tokens

memstack-security-rls-checker

Use this skill when the user says 'check RLS', 'audit RLS', 'RLS policies', 'row level security', 'Supabase security audit', or needs to verify table-level access control. Audits Supabase Row Level Security policies across all tables. Do NOT use for non-Supabase projects or writing RLS policies from scratch.

cwinvestments/memstack · 80 tokens

memstack-security-rls-guardian

Use this skill when creating or altering database tables in Supabase or PostgreSQL projects. Triggers include: CREATE TABLE, ALTER TABLE, migration files, 'RLS', 'row level security', 'new table', 'database schema'. Enforces Row Level Security policies on every table to prevent unauthorized data access. Do NOT use for…

cwinvestments/memstack · 84 tokens