mysql-ddl-scout

Inspects MySQL DDL files offline and returns strict JSON for table existence, columns, keys, and parser AST. Use when exploring database schemas from .sql/.ddl files, validating columns or foreign keys, or when the user mentions MySQL DDL, schema inspection, or table metadata without a live database.

marceloxp/mysql-ddl-scout1 installsMITSynced Aug 26

Works with

Claude CodeCursorCodex CLIGitHub CopilotGemini CLI
---
name: mysql-ddl-scout
description: Inspects MySQL DDL files offline and returns strict JSON for table existence, columns, keys, and parser AST. Use when exploring database schemas from .sql/.ddl files, validating columns or foreign keys, or when the user mentions MySQL DDL, schema inspection, or table metadata without a live database.
license: MIT
---

# mysql-ddl-scout

Inspect MySQL DDL files (one table per file) offline and get structured JSON via the `mysql-ddl-scout` CLI.

## Prerequisites

The CLI must be available on the machine:

- Global: `mysql-ddl-scout` (after `npm install -g mysql-ddl-scout`)
- Ephemeral: `npx mysql-ddl-scout` (no install)

This skill tells the agent **when and how** to call the CLI. It does not replace the CLI.

## Resolve the DDL folder

Identify `<ddl_folder>` from the project context — common locations include `db/`, `schema/`, `migrations/`, `sql/`, or `database/`. Prefer an absolute path. Each table is stored as `tableName.sql`, `tableName.ddl`, or `tableName` (no extension).

## Recommended workflow

1. **`--exists`** — confirm table files exist before deeper inspection
2. **`--fields_info`** — column types, nullability, defaults, ENUM/SET values
3. **`--keys_info`** — primary keys, indexes, unique constraints, foreign keys
4. **`--ast`** — parser AST only when debugging parser output or building custom tooling

## Commands

Replace `<ddl_folder>` and `<table>` with actual values. Prefix with `npx` when the CLI is not installed globally.

```bash
mysql-ddl-scout <ddl_folder> --exists <table> [table...]
mysql-ddl-scout <ddl_folder> --fields_info <table>
mysql-ddl-scout <ddl_folder> --fields_info <table>:<col1>,<col2>
mysql-ddl-scout <ddl_folder> --keys_info <table>
mysql-ddl-scout <ddl_folder> --ast <table>
```

### `--exists`

- Accepts one or more table names (space-separated)
- Always exits `0` on success
- Returns JSON array: `{ "table", "exists", "path" }` (`path` is absolute when found, `null` otherwise)

### `--fields_info`

- Single table only
- Format: `table` (all columns, DDL order) or `table:col1,col2` (requested order)
- Unknown columns appear as `{ "field": "...", "exists": false }` with exit code `1`
- ENUM/SET include `values`; DECIMAL uses `precision` and `scale`; numeric types may include `unsigned: true`; generated columns include `generated` (`stored`|`virtual`); timestamps may include `on_update`

### `--keys_info`

- Single table only
- Returns `{ "primary_keys", "indexes", "foreign_keys" }`
- Unique indexes include `"unique": true`
- Foreign keys include `on_delete` and `on_update` when defined
- Prefix indexes preserve length suffix (e.g. `"name(20)"`)

### `--ast`

- Single table only
- Returns the `node-sql-parser` CREATE TABLE AST node as JSON

## Output contract

- **Success**: minified JSON on `stdout` only — no banners, markdown, or extra text
- **Operational error**: `{"error":"message"}` on `stderr`, exit code `1`
- Parse `stdout` as JSON; on non-zero exit, read and parse `stderr` as JSON when present

## Examples

For concrete command/output samples, see [examples.md](examples.md).

More Database skills

azure-upgrade

microsoft/azure-skills

Assess and upgrade Azure workloads between plans, tiers, or SKUs, or modernize Azure SDK dependencies in source code. WHEN: upgrade Consumption to Flex Consumption, upgrade Azure Functions plan, change hosting plan, function app SKU, migrate App Service to Container Apps, modernize legacy Azure Java SDKs (com.microsoft.azure to com.azure), migrate Azure Cache for Redis (ACR/ACRE) to Azure Managed Redis (AMR).

413.0k

supabase-postgres-best-practices

supabase/agent-skills

Postgres best practices maintained by Supabase, for Postgres running anywhere. Load this skill BEFORE writing or changing anything that lives in a Postgres database: creating or altering tables and columns (including choosing column types), schema design, migrations and declarative schema files, RLS policies and the tests that verify them, indexes, triggers, database functions, queues and scheduled jobs (pg_cron, pgmq), vector/semantic search (pgvector), and restoring dumps (pg_restore) or importing data. Also load it when diagnosing slow queries, high CPU, timeouts, EXPLAIN plans, connection exhaustion, locking, bloat, or rows visible to the wrong user or tenant. This is not just a performance guide — schema, migration, security, and SQL authoring tasks need these rules too, even for a one-column change or a single query.

377.3k

prisma-database-setup

prisma/skills

Guides for configuring Prisma with different database providers (PostgreSQL, MySQL, SQLite, MongoDB, etc.). Use when setting up a new project, changing databases, or troubleshooting connection issues. Triggers on "configure postgres", "connect to mysql", "setup mongodb", "sqlite setup".

247.3k

← All Database skills

Check your AI visibility

One URL in, a 0–100 score and the exact fixes out.

RUN THE CHECK

Browse all the tools

15 tools across six categories
13 of them never send your data anywhere

Free · No signup · No trial clock

SEE THE DIRECTORY