database

Inspect live database schema, run read-only queries, and execute Eloquent operations via REPL.

Updated Jul 11, 2026
One-click install
npx skills add https://github.com/danielsuguimoto/skills --skill database-danielsuguimoto
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: database
Source: https://github.com/danielsuguimoto/skills/tree/main/skills/database
Command: npx skills add https://github.com/danielsuguimoto/skills --skill database-danielsuguimoto

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Code artifacts like migrations, seeders, and schema dumps describe intent, not reality. This Skill treats the live database as the source of truth, giving you structured workflows to inspect actual schema, validate row counts, reconcile UI widget counts against raw SQL, and perform safe read/write operations. ## Core Features & Use Cases - Schema Discovery Workflow: List connections, get cheap table summaries, then drill into full column metadata, indexes, foreign keys, views, and routines with filtered inspection. - Read-Only Querying: Run SELECT, SHOW, EXPLAIN, and DESCRIBE statements with guidance on soft deletes, company scoping, column qualification, and result limiting. - Count Reconciliation: Diagnose mismatches between UI widget counts and raw SQL by tracing repository query paths and replicating queryScope filters one at a time. - Safe REPL Writes: Perform Eloquent mutations only with explicit user approval, using transactions for experiments and awareness of fired model events and subscribers. - Use Case: A Filament widget shows 1,204 records but your raw SQL returns 1,389. Use this Skill to read the widget's query path, reproduce its JOINs and WHERE clauses, and identify the missing partial-access filter causing the gap. ## Quick Start Inspect the live database schema for the contacts table and run an EXPLAIN plan on my slow query.

Frequently Asked Questions about database

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I inspect database schema without reading migration files?▼

Use the schema inspection tool against the live database, which reflects current reality rather than migration intent. Start with summary mode for table names and column types, then re-call with a table filter and column details enabled for indexes, foreign keys, and defaults.

How to reconcile a UI widget count with raw SQL query results?▼

Read the widget's query path in the repository code, reproduce every JOIN and WHERE with a SELECT COUNT(*) query, then add queryScope filters one at a time until counts match. The gap is usually company precedence unions, partial-access filters, or status exclusions the raw SQL omits.

When should I use a REPL instead of a read-only SQL query tool?▼

Use the REPL when you need Eloquent semantics like scopes, accessors, casts, or relationship output, or when performing writes. Prefer the read-only query tool for raw SELECT and EXPLAIN statements since it is faster and does not boot the full application.

Why does my raw SQL return more rows than the application shows?▼

Raw SQL bypasses global scopes, so soft deletes and company scoping are not applied automatically. Add deleted_at IS NULL conditions manually and replicate the application's queryScope filters to match application-level counts.

Can I run UPDATE or DELETE statements through the read-only query tool?▼

No, the read-only query tool rejects mutating statements and only accepts SELECT, SHOW, EXPLAIN, and DESCRIBE. Mutations must go through the REPL with explicit user approval, ideally wrapped in a transaction for safe experimentation.