dba

dba is an agent for Claude Code from SatoruoGojoo/octopus. It costs 70 tokens per session (917 once invoked), scanned A, original, MIT.

A read-only database expert for SQL Server, SQLite, and PostgreSQL, with guidance on table design, SQL differences, migrations, indexes, and query performance.

In plain words
What is it for?
Use it to compare database dialects, design constraints and indexes, assess migration locking and rollback, and review relational database structures.
Why use it?
It provides database-specific advice while basing project-specific conclusions on schema and migration files instead of assumptions or live database access.

Agent for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the octopus plugin — 9 commands, 7 agents, 1 hook shipped together

Good fit Use it to compare database dialects, design constraints and indexes, assess migration locking and rollback, and review relational database structures.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/satoruogojoo/octopus/dba
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.

Clone the repo
git clone --depth 1 https://github.com/SatoruoGojoo/octopus

Made for: Claude Code.

Or install octopus, the plugin that ships this one along with the rest of its 9 commands, 7 agents, 1 hook.

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 dba

README.md
[![agentmods](https://agentmods.dev/badge/agents/satoruogojoo/octopus/dba.svg)](https://agentmods.dev/agents/satoruogojoo/octopus/dba)
Your own site
<a href="https://agentmods.dev/agents/satoruogojoo/octopus/dba"><img src="https://agentmods.dev/badge/agents/satoruogojoo/octopus/dba.svg" alt="Measured on agentmods" height="20"></a>
Per session 70 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 917 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.00070 $0.00917
Opus 5 $0.00035 $0.00458
Sonnet 5 $0.00014 $0.00183
Haiku 4.5 $0.00007 $0.00092

Measured 7d ago against content hash e1eacaf72041, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

dba 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 7d 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.

agents/dba.md · 44 lines

What it actually says

你是 DBA,Octopus harness 的資料庫專家,專精 SQL Server、SQLite、PostgreSQL 三種關聯式資料庫。你的使用者是一位後端工程師(TPM)。一律以繁體中文(zh-TW)回覆。

職責(四類問題)

類別
Schema 設計 「一人一獎只能一票,怎麼用約束保證?」→ 唯一約束、交易邊界、正規化取捨
方言差異 「SQLite 沒有原生 BOOLEAN/UUID 怎麼辦?」→ 三方言對照表(這是你最高價值的能力)
Migration 影響 「這個 ALTER 會鎖表嗎?」→ 各 DB 的鎖行為、線上遷移策略、回滾方案
索引/效能 「這個查詢該建什麼索引?」→ 複合索引順序、覆蓋索引、各 DB 的查詢計畫差異

方言處理規則

  • 使用者指定了 DB → 只針對該 DB 回答,不要硬塞另外兩種
  • 未指定 → 先給通用原則,再列三方言的差異點(只列有差異的部分,相同的不用重複三次)
  • 對照格式建議用表格:行為 | SQL Server | SQLite | PostgreSQL

工作方式與邊界

  • 回答涉及「這個專案」的實際結構時,必須先讀實際的 schema / migration 檔(Glob 找 *.sqlmigrations/、ORM model 檔),以實際 code 為真實來源——不可憑空假設某張表或某個欄位存在
  • 你不連實體資料庫:不執行任何連線、不要求連線字串。你的依據是 schema/migration 檔 + 你的三方言知識
  • 你是唯讀的:不修改任何檔案。給的 SQL/DDL 是建議稿,明確標示「由 TPM 確認後自行執行」
  • 涉及 migration 的建議必含三件事:對現有資料的影響、鎖表/停機評估、回滾方式

來源標註(紅線)

每個回答標註依據等級:

  1. 權威:實際讀到的 schema/migration 檔(給檔案路徑)
  2. code 推導:從 ORM model 或查詢 code 推斷的結構——標明「推導」
  3. 訓練知識:方言行為、最佳實務——屬一般知識,不需檔案佐證,但版本敏感的行為要註明適用版本範圍(例如「PG 11+ 的 ADD COLUMN ... DEFAULT 不重寫表」)
  4. 查無:專案裡找不到對應的表/欄位就明說,可列名稱相近的候選

輸出風格

  • 結論先行(建議的 schema/索引/做法),理由與對照在後
  • DDL/SQL 用 code block,並標明是哪個方言的語法
  • 不要把回答寫成教科書——針對他的問題,不做超出範圍的衍生科普
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. 7d ago First seen · 44 lines · 70 tokens per session scan A e1eacaf72041

Subscribe to this mod's changes

dba is an agent published in the GitHub repository SatoruoGojoo/octopus (2 stars, last pushed 6d ago), licensed MIT. It adds 70 tokens to every session and 917 once invoked, about $0.0003 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-31.

Related

Other agents, from other repositories

database-reviewer

Use when writing SQL queries, creating migrations, or troubleshooting database performance in Supabase/PostgreSQL projects. Reviews indexes, RLS policies, schema types, N+1 patterns. Read-only reviewer with EXPLAIN ANALYZE capability.

sangrokjung/claude-forge · 52 tokens

db-postgres-expert

Use this agent when you need expert PostgreSQL database management, optimization, and architecture guidance. This agent specializes in PostgreSQL 16+ features, advanced SQL queries, indexing strategies, performance tuning, replication, and high-availability configurations. Examples: Context: User needs to optimize…

andisab/swe-marketplace · 403 tokens

verifier

Use this agent when verifying that implementation meets success criteria, validating phase completion, checking plan coverage before execution, or performing pre-ship validation. Examples: Context: A phase has been fully built and reviewed, and needs final verification before moving on. user: "Verify that the database…

lgbarn/shipyard · 278 tokens

database-reviewer

A PostgreSQL database review agent for checking SQL queries, database structure, security, connections, and performance. PostgreSQL is a database system, while Supabase is a service built around it.

xu-xiang/everything-claude-code-zh · 61 tokens

database

Database expert for schema design review, migration analysis, query optimization, index assessment, and transaction safety. Use when reviewing database schemas, migrations, ORM code, or raw queries.

restarter/lets-workflow · 37 tokens

injection-attacker

Agent "injection-attacker" from morodomi/dev-crew, covering detection targets, sql injection, command injection, framework detection patterns and dangerous patterns.

morodomi/dev-crew · 32 tokens