# P3ngu1nzz V Daemon DB API

> db-api skill

- Skill: `tomevault-io/p3ngu1nzz-v-daemon-db-api` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/p3ngu1nzz-v-daemon-db-api`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/p3ngu1nzz-v-daemon-db-api/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Integrations & APIs
- Author: tomevault-io (https://skillmd.com/u/tomevault-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tomevault-io/p3ngu1nzz-v-daemon-db-api

---


# db-api skill

The db-api skill exposes the repository's SQLite database to agents via a lightweight CLI (scripts/db.sh) and a small Python wrapper (scripts/skills/db-api.py). Use this skill for safe, read-first operations and limited CRUD tasks when a full service layer is not available.

## Usage

- scripts/skills/db-api.py list-tables
- scripts/skills/db-api.py status
- scripts/skills/db-api.py show-table todos
- scripts/skills/db-api.py view todos [limit|'all'] [format]    # formats: pretty (default), raw, csv
- scripts/skills/db-api.py view todos all pretty
- scripts/skills/db-api.py view todos 10 csv
- scripts/skills/db-api.py query "SELECT count(*) FROM todos;"

## Output formats and status fields

- view: supports three output formats:
  - pretty: sqlite3 -header -column (human-friendly table with column headers)
  - raw: pipe-delimited values without headers (good for scripting)
  - csv: header + CSV output
- status: prints the following fields to aid agents and operators:
  - DB_PATH, size, last_modified, last_access
  - tables: list of table names
  - table_row_counts: per-table counts
  - table_count: total number of tables
  - PRAGMA values: journal_mode, foreign_keys, busy_timeout
  - connected_processes: lsof output if available

## Troubleshooting

- Ensure sqlite3 is installed and scripts/lib/sql.sh DB_PATH points to the expected DB file (default: run/v-daemon.db).
- If WAL cannot be enabled, move the DB to a WAL-capable filesystem (avoid certain CIFS mounts).
- PRAGMA settings like foreign_keys must be applied per-connection; scripts/lib/sql.sh sets sensible defaults per run.
- Check run/system.log and logs/sql-agent.log for initialization and errors.

## Notes

- Do not run untrusted SQL via the `query` endpoint; treat it as an administrative capability.
- For complex or high-frequency DB work, implement a dedicated service layer rather than giving agents direct SQL access.
- See docs/db-api.md and docs/db-api-spec.md for full reference and examples.

---
> Converted and distributed by [TomeVault](https://tomevault.io/claim/p3ngu1nzz) — claim your Tome and manage your conversions.
<!-- tomevault:4.0:skill_md:2026-04-14 -->

