Token导航 LogoToken导航TokenDH.com
运维和基础设施敏感数据github未标认证来源可访问许可证需确认审计异常

db-query-executor数据库查询执行器

Agent Skill

db-query-executor 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

282

周安装

12

GitHub Stars

公开资料未说明

下载量

99
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:db-query-executor(数据库查询执行器)
来源仓库:https://github.com/aleister1102/skills
仓库路径:skills/db-query-executor
安装命令:
npx skills add https://github.com/aleister1102/skills --skill db-query-executor
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/aleister1102/skills --skill db-query-executor

简介

db-query-executor 允许在容器化数据库环境中直接执行 SQL 或 NoSQL 查询语句。

  • 适用于数据检查、清理、迁移和维护任务,支持 PostgreSQL、MySQL、MongoDB 和 Redis。
  • 需先设置数据库连接环境变量,再通过命令执行查询并验证结果准确性。
  • 严禁在生产环境直接运行,仅限开发或测试用途,防止意外数据损坏或泄露。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

Db Query Executor

Overview

Execute database queries directly in development containers to perform data operations, migrations, cleanup, and maintenance tasks. This skill provides tools to inspect, modify, and troubleshoot database contents for PostgreSQL, MySQL, MongoDB, and Redis.

Quick Start

  1. Identify the target container (database service name)
  2. Set database connection environment variables
  3. Execute queries to inspect or modify data
  4. Verify changes

Common Tasks

Execute Raw SQL/Commands

  • "Run a SQL query against the postgres container"
  • "Execute a query to list all tables in the database"
  • "Get all records from a specific collection"

Data Inspection

  • "Show me all records in the users table"
  • "List all collections in the MongoDB database"
  • "Check Redis keys matching a pattern"

Data Modification

  • "Update all records in a table"
  • "Delete orphaned records from the database"
  • "Reset a specific field value"

Data Cleanup

  • "Clean up test data for a specific environment"
  • "Remove expired sessions from the database"
  • "Delete duplicate records"

Usage

Prerequisites

  • Docker or container runtime access
  • Database credentials (stored in environment variables)
  • Container name or service identifier

Environment Variables

  • DB_HOST: Database host (default: localhost)
  • DB_PORT: Database port (default: 5432 for PostgreSQL)
  • DB_NAME: Database name
  • DB_USER: Database user
  • DB_PASSWORD: Database password
  • CONTAINER_NAME: Target container name (optional, auto-detected if not specified)

Supported Databases

  • PostgreSQL
  • MySQL
  • MongoDB
  • Redis

Scripts

scripts/db_query.py

Execute database queries against running containers.

Usage:

python scripts/db_query.py --container <name> --query "<sql>" [--type <db_type>] [--output <format>]

Options:

  • --container: Target container name
  • --query: SQL query or database command to execute
  • --type: Database type (postgres, mysql, mongodb, redis)
  • --output: Output format (table, json, csv)

scripts/db_inspect.py

Inspect database structure and contents.

Usage:

python scripts/db_inspect.py --container <name> [--type <db_type>] [--list-tables] [--list-collections] [--sample <table>]

Options:

  • --container: Target container name
  • --type: Database type (postgres, mysql, mongodb, redis)
  • --list-tables: List all tables (PostgreSQL/MySQL)
  • --list-collections: List all collections (MongoDB)
  • --sample <table>: Show sample records from a table/collection

scripts/db_cleanup.py

Clean up data based on patterns or conditions.

Usage:

python scripts/db_cleanup.py --container <name> [--type <db_type>] [--dry-run] [--pattern <regex>] [--older-than <days>]

Options:

  • --container: Target container name
  • --type: Database type (postgres, mysql, mongodb, redis)
  • --dry-run: Show what would be deleted without making changes
  • --pattern <regex>: Delete records matching a pattern
  • --older-than <days>: Delete records older than specified days

Examples

Execute Raw Query

# List all tables
python scripts/db_query.py \
  --container postgres \
  --query "SELECT table_name FROM information_schema.tables WHERE table_schema = 'public';"

# Get sample data
python scripts/db_query.py \
  --container postgres \
  --query "SELECT * FROM users LIMIT 10;"

Inspect Database

# List all tables
python scripts/db_inspect.py --container postgres --type postgres --list-tables

# Show sample from a table
python scripts/db_inspect.py \
  --container postgres \
  --type postgres \
  --sample users

Cleanup Data

# Dry run to see what would be deleted
python scripts/db_cleanup.py \
  --container postgres \
  --type postgres \
  --pattern "test_.*" \
  --dry-run

# Actually delete
python scripts/db_cleanup.py \
  --container postgres \
  --type postgres \
  --pattern "test_.*"

Redis Operations

# List all keys
python scripts/db_query.py \
  --container redis \
  --type redis \
  --query "KEYS *"

# Get value by key
python scripts/db_query.py \
  --container redis \
  --type redis \
  --query "GET user:123"

# Delete keys matching pattern
python scripts/db_query.py \
  --container redis \
  --type redis \
  --query "DEL user:*"

Troubleshooting

Connection Issues

  • Verify container is running: docker ps | grep <container>
  • Check environment variables are set correctly
  • Ensure database port is exposed

Query Errors

  • Verify syntax for your database type
  • Check table/collection names exist
  • Ensure proper permissions for the database user

Permission Denied

  • Verify database user has necessary permissions
  • Check container network access
  • Review database authentication configuration

Resources

references/database-schemas.md

Database schema documentation and common table structures.

references/faq.md

Frequently asked questions and troubleshooting tips.

references/best-practices.md

Best practices for database maintenance and data integrity.

references/command-reference.md

Database-specific command reference for each supported database type.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

37.91%
按下载量换算38

Claude

31.42%
按下载量换算31

Cursor

18.49%
按下载量换算18

Gemini CLI

9.38%
按下载量换算9

安全审计

Gen Agent Trust Hub

未通过

Socket

通过

Snyk

通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills