Agent Skillsopskat/opskat › database

database

GitHub

通过执行命令对MySQL、PostgreSQL等数据库运行SQL语句,支持读写操作及多语句策略检查,自动解析凭证并提供结果。

internal/ai/skills/database/SKILL.md opskat/opskat

Trigger Scenarios

需要查询或修改数据库内容 执行SQL语句进行数据操作

Install

npx skills add opskat/opskat --skill database -g -y
More Options

Non-standard path

npx skills add https://github.com/opskat/opskat/tree/main/internal/ai/skills/database -g -y

Use without installing

npx skills use opskat/opskat@database

指定 Agent (Claude Code)

npx skills add opskat/opskat --skill database -a claude-code -g -y

安装 repo 全部 skill

npx skills add opskat/opskat --all -g -y

预览 repo 内 skill

npx skills add opskat/opskat --list

SKILL.md

Frontmatter
{
    "name": "database",
    "description": "Run SQL against a database asset (MySQL, PostgreSQL, SQL Server, SQLite) via exec. Covers SQL syntax and the database scope parameter."
}

Database assets

Command syntax

Pass the SQL verbatim as command:

  • SELECT id, name FROM users LIMIT 10
  • SHOW TABLES
  • DESCRIBE orders
  • UPDATE users SET active = 0 WHERE id = 3

Scope

Use scope to override the default database for this call, e.g. scope: "analytics".

Notes

  • Reads (SELECT / SHOW / DESCRIBE / EXPLAIN) return rows as JSON; writes return an affected-row count.
  • Multi-statement input is split and each statement is policy-checked separately, so a read cannot smuggle a write past approval.
  • Credentials are resolved automatically; never ask the user for a password.

Asset config (for put_asset)

field type required notes
host string yes
port number yes 3306 (mysql) / 5432 (postgresql) / 1433 (mssql)
username string yes
password string no Stored encrypted; never echoed back
driver string yes "mysql", "postgresql", or "mssql"
database string no Default database; empty string clears it
read_only string no "true" enables read-only mode
query_timeout_seconds number no Per-query timeout override, in seconds
ssh_asset_id number no SSH asset to tunnel through; 0 detaches

"sqlite" is not creatable through put_asset: the validator requires host + port + username unconditionally, and SQLite doesn't use any of them, so the request always fails validation. Create SQLite assets from the desktop UI instead.

Version History

  • d6c7a6e Current 2026-08-16 07:28

    修正文档遗漏了database技能的query_timeout_seconds配置项说明。

  • aeb4bc3 2026-07-24 16:28

Same Skill Collection

internal/ai/skills/etcd/SKILL.md
internal/ai/skills/k8s/SKILL.md
internal/ai/skills/kafka/SKILL.md
internal/ai/skills/local/SKILL.md
internal/ai/skills/mongodb/SKILL.md
internal/ai/skills/oss/SKILL.md
internal/ai/skills/rdp/SKILL.md
internal/ai/skills/redis/SKILL.md
internal/ai/skills/serial/SKILL.md
internal/ai/skills/ssh/SKILL.md
internal/ai/skills/vnc/SKILL.md
plugin/opsctl/skills/opsctl/SKILL.md

Metadata

Files
0
Version
d6c7a6e
Hash
7f6f96ef
Indexed
2026-07-24 16:28

inicio - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-19 09:32
浙ICP备14020137号-1 $mapa de visitantes$