About Dryrun
Dryrun is an MCP server published by boringSQL in the Data category: postgreSQL schema intelligence MCP server with offline linting, migration safety, query validation for AI coding assistants. Conduid read 12 tools from its source: advise, check_drift, check_migration, columnar_report, describe_table, detect and 6 more. No package is published for it, so it installs from a source checkout.
The repository has 37 stars and 4 forks, and its last commit was on 28 Nov 2026. Conduid has no tagged release on record for it. It passes all 1 static checks Conduid ran on the repository. Its topics include ai-coding-assistant, cli, database, migration-safety, postgresql and query-validation.
Install
git clone https://github.com/boringSQL/dryrunTools (12)
advisecheck_driftWhen a migration may have run since the snapshot, or before acting on an offline answer that is expensive to get wrong: compares the live database against the newest snapshot in the local history and reports ahead, behind, or diverged with the objects that differ, naming the baseline it used. Requires a connection, so it is absent in offline mode. Read-only: it refreshes nothing (`dryrun snapshot capture` does) and changes nothing.check_migrationBefore any ALTER TABLE, CREATE INDEX, DROP, or other DDL reaches a database: the lock level each statement takes, whether it rewrites the table, and rollback_ddl where one applies. Tables created earlier in the same input are recognized as empty, so statements against them are not flagged for scans or rewrites they cannot cause. Where the safe form is mechanical it returns safer_sql -- the rewrite as statements to run in order, each on its own rather than wrapped in one transaction. When at least one statement is unsafe and every unsafe statement has one, migration_sql bundles the whole input as one runnable file -- unsafe statements replaced by safer_sql, safe ones passed through unchanged; it is absent otherwise, since a file that still holds an unsafe statement (including a statement type this tool cannot analyze) would be worse than no file at all. ddl may be a pasted migration file: goose (-- +goose Up/Down), dbmate (-- migrate:up/down) and tern (---- create above / drop below ----) markers are recognized, and direction (default up) picks the half to analyze; migration_sql is re-wrapped to stay runnable by that runner. Needs no database connection and applies nothing. It does not estimate wall-clock duration, and not every unsafe statement has a rewrite: a column type change or a backfill needs a batch size and a deploy order this tool cannot decide for you.| Parameter | Type | Description |
|---|---|---|
| ddl * | string | DDL statement, or a whole goose/dbmate/tern migration file. |
| direction | string | Which half of a migration file to check: 'up' (default) or 'down'. Plain SQL has no down section, so direction='down' errors there. |
columnar_reportAlloyDB only, when a scan should be served by the columnar engine and is not: resident columns, empty column store, stale blocks, with findings. Needs a live AlloyDB connection: it errors on stock PostgreSQL and is absent in offline mode. Read-only; it populates and configures nothing.describe_tableBefore writing SQL against a table you have not read in this session, before a JOIN, or before a DELETE that might cascade: one table in full -- its columns and types, constraints, indexes, and planner stats. Needs no database connection; answers from the snapshot, and points at detect when the table has findings. detail=relations gives the incoming and outgoing foreign keys, each with a JOIN clause you can paste and the ON DELETE / ON UPDATE action it carries (declared constraints only, one hop, so a table reached by a cascade may cascade further). detail=stats adds vacuum: dead tuples, trigger points, effective autovacuum knobs and last vacuum/analyze times, for any table over 10k rows whether or not detect flagged it. Ask for the ddl field to get the CREATE TABLE that would rebuild it, with whatever the snapshot cannot reproduce listed beside it. Ask for dependents to see the captured views that read this table directly or through other views before changing or dropping it; depth 1 carries table columns, deeper rows carry via parent views. Structure as of the last capture: no row data, and nothing a later migration changed.| Parameter | Type | Description |
|---|---|---|
| columns | array | Only these columns, by exact name. The way to read four columns of a wide table. |
| detail | string | Detail level: 'summary' (default), 'full' (raw stats), 'stats' (profiles, stats and vacuum only), 'relations' (foreign keys on both sides, no columns). |
| fields | array | Whitelist of sections: columns, indexes, constraints, stats, partition_info, column_profiles, comment, policies, triggers, reloptions, rls_enabled, ddl, vacuum, relations, dependents. Ask for ddl to get the CREATE TABLE, or dependents for the views that read this table, including indirect ones. |
| limit | number | Max columns, indexes, constraints, partition children, relations per direction and dependents (default 50, 0 for all). Key, unique and indexed columns are kept past it, as are relations that cascade or clear on delete. |
| schema | string | Schema name. Without it a bare name resolves in public, or in the one schema that holds it. |
| table * | string | Table name, bare or schema-qualified. |
detectWhen a query got slow, before a tuning change, when autovacuum or dead tuples come up, or when asked what is wrong with this database: stale statistics, unused indexes, bloated indexes and tables, per-table scan anomalies, and vacuum health. kind=vacuum_health reports autovacuum_disabled, default_knobs_large_table, high_dead_tuple_ratio, vacuum_threshold_too_high, freeze_age_high and mxid_age_high, each with the dead-tuple counts and last (auto)vacuum and analyze times behind it. Every kind reports offenders only: a table with nothing wrong does not appear, here or in kind=all. For a table with no finding, describe_table detail=stats carries its raw counters and last vacuum/analyze times. Needs no database connection: findings are as fresh as the last capture, and quiet where it carries no node statistics. It reports only -- no VACUUM, no ANALYZE, no settings changed. Caveats for a finding arrive with it in _meta.hint.| Parameter | Type | Description |
|---|---|---|
| kind | string | Which detection to run (default: all). |
| limit | number | Max entries per category (default 50, 0 = all; a response over 1 MiB is refused, so page with offset instead). |
| offset | number | Skip N entries of each list; for a single kind only (kind=all pages through the _meta.next calls it emits). |
| schema | string | Schema filter; omit for all schemas. |
| table | string | Table filter, bare or schema-qualified. |
| threshold | number | Bloat ratio threshold; applies to kind=bloated_indexes, kind=bloated_tables and kind=all. |
explain_queryWhen you need the real plan for one query: runs EXPLAIN against the connected database. analyze=true runs EXPLAIN ANALYZE, which EXECUTES the query inside a transaction that is always rolled back -- writes do not persist, but their work and any triggers still run. Planner GUCs are replayed via SET LOCAL for plan parity where the snapshot captured them, so the query runs under them (e.g. prod work_mem); older snapshots carry none and get the server's own settings. Requires a connection, so it is absent in offline mode. It returns the plan; pass it to advise as plan_json to have it interpreted.| Parameter | Type | Description |
|---|---|---|
| analyze | boolean | Run EXPLAIN ANALYZE (executes the query). |
| node | string | Which node's stats to use (multi-node only). |
| pgmustard | boolean | Submit plan to pgMustard for extra tips. |
| sql * | string | SQL query. |
| with_stats | boolean | Inject snapshot stats before EXPLAIN. |
find_objectsFirst call against an unfamiliar database, and the way to find where a name lives. With no query it inventories what exists and how big it is in production -- row estimates and table size (the heap: indexes and TOAST are not counted), partition children folded into their parent -- which the repo cannot tell you; kind= inventories views, functions or enums instead. With a query it searches names, table and column comments, index and view definitions, and enum labels, so a value like 'cancelled' finds the enum that carries it, not just an object named after it. Every hit is tagged with the field it matched (matched_on) and exact name matches rank first. Needs no database connection. Case-insensitive substring only -- no regex, no fuzzy matching, and never row data. Function bodies are not in the snapshot, so a name that appears only inside one is not findable here. One line per object: describe_table is what reads a table in full.| Parameter | Type | Description |
|---|---|---|
| kind | string | Restrict to one kind. Default: tables when there is no query, every kind when there is one. |
| limit | number | Max results (default 50, 0 = all; a response over 1 MiB is refused, so page with offset instead). Truncation sets _meta.next to the next page (offset). |
| offset | number | Skip N results. |
| query | string | Case-insensitive substring. Omit to inventory rather than search. |
| schema | string | Schema filter; omit for all schemas. |
| sort | string | Order: 'name', or 'rows'/'size' biggest first (objects that have no table sort last). Default is name without a query, match quality with one. |
lint_schemaWhen reviewing a schema as a whole -- a design review, an inherited database, or the state a migration left behind: naming and convention violations plus an audit of missing keys, unindexed foreign keys, and unsafe defaults. Needs no database connection. Defaults to verbosity='summary', which returns per-rule counts only: pass verbosity='full' for the findings and their ddl_fix (not every finding has one). Whole-schema, not per-query (validate_query, advise); it applies nothing.| Parameter | Type | Description |
|---|---|---|
| fields | array | Whitelist of sections: conventions, audit. Overrides 'scope' when set. |
| schema | string | Schema filter; omit for all schemas. |
| scope | string | Scope: 'conventions', 'audit', or 'all' (default). |
| table | string | Table filter, bare or schema-qualified. |
| verbosity | string | Verbosity: 'summary' (counts and rule names) or 'full' (findings, examples, ddl_fix). |
list_top_queriesWhen asked what this database spends its time on: captured pg_stat_statements query shapes ranked by exec time, calls, or mean. Needs no database connection; reads the local history (dryrun snapshot capture --streams query, or init's best-effort capture) and is empty when no capture carries query stats. Each entry is tagged with its reporting node and never averaged across nodes: a primary and a replica are different workloads. A node label that rotates between servers reports only the server that answered its newest capture; _meta.hint says so when the captures show it. SQL is qshape-normalized and parameterized, never the literal text or parameter values a user ran. Counters are cumulative since the last reset, not a recent-activity rate. It reports the newest capture per node and differences nothing, so it says what the corpus has cost since that reset, never what it cost this week; snapshot_diff kind=query is what differences them, and _meta.history, when present, says what the local store holds. An empty result carrying unknown: true means no capture holds query stats at all, which is not the same as a database whose statements are all cheap. Before comparing or differencing any two numbers, read _meta.hint: each caveat there is prefixed BLOCKING: (the obvious reading is wrong, e.g. nodes with different counter windows must not be ranked against each other), COMPARABILITY: (not comparable with the node's previous capture) or SCOPE: (narrower than it looks).| Parameter | Type | Description |
|---|---|---|
| limit | number | Max results (default 50, 0 = all; a response over 1 MiB is refused, so page with offset instead). |
| min_calls | number | Skip entries with fewer calls than this (default 2) to filter one-shot noise. |
| node | string | Filter to one node label. Omit to see all nodes' queries together (each entry still tagged with its own node). |
| offset | number | Skip N results; a truncated result sets _meta.next to the next page. Ranking is of the newest capture per node, so a capture landing between pages can shift it. |
| sort | string | Sort by: 'total_time' (default, total_exec_time_ms), 'calls', or 'mean_time' (mean_exec_time_ms). |
snapshot_diffWhen something changed and you need to know what: the schema DDL delta between two snapshots, plus planner sizing, activity, and query-shape drift correlated to the same capture window. Needs no database connection, but does need two snapshots in the local history. Snapshot-to-snapshot only, never against the live database (check_drift); it reports what moved, not why. Totals are a delta over the interval between the two anchors, not a rate: capture cadence is irregular, so deltas over unequal intervals do not compare. Each per-node query delta reports that interval as `window` in nanoseconds (window_minutes is a different number: how far a planner or activity capture may sit from an anchor to be correlated to it); planner and activity deltas carry none, so use the anchors' taken_at. Divide by it only when incomparable is empty and window is above zero, and never for an entry whose status is reset or truncated: their delta is a cumulative counter, which is why they are counted in not_subtractable and left out of totals. Caveat codes qualify query numbers rather than refute them; summary.query_caveat_codes and the notes explain each. plan_shifts flags queryids whose blocks per call stepped up against the three prior windows while rows per call did not (suspected plan flips, ranked by excess blocks); read `suppressed` and `no_baseline` before treating an empty list as no flips. An activity or query delta with incomparable set was refused (one label covered two servers) and carries no rows; it is not a quiet node. _meta.history, when present, says what the local store holds per stream and over what span. A result over ~64 KB is cut (truncated_by=bytes); page it with the offset in _meta.next, since raising limit will not help.| Parameter | Type | Description |
|---|---|---|
| from | string | Base snapshot: 'latest~N' or a content-hash prefix. Default 'latest~1'. latest~N counts captures, not changes: a node captured while unchanged stores an identical snapshot, so an empty delta can mean nothing moved between two real captures. |
| kind | string | Timeline the refs name and the headline delta; the other kinds are correlated by capture time. Use 'planner' when the schema is stable but stats/sizing moved, 'query' for pg_stat_statements drift (per shape, per node). |
| limit | number | Max objects (and moved raw rows in full view); 0 = as many as fit in one response (~64 KB of JSON text). A cut page reports truncated_by (limit|bytes) and limit_applied; _meta.next holds the call for the next page, pinned to the same anchor snapshots (correlated planner/activity captures are re-matched per page). |
| node | string | Activity node label, when activity has multiple nodes. |
| offset | number | Skip the first N objects (and, in full view, N rows of each raw list), to page past a truncated result. The summary view's plan_shifts are not paged. |
| schema | string | Narrow to one schema. |
| table | string | Narrow to one table. Bare names only: unlike detect and lint_schema this filter runs against the snapshots being compared, not the loaded one. |
| to | string | Target snapshot: 'latest' or a content-hash prefix. Default 'latest'. |
| view | string | 'summary' (ranked objects + counts) or 'full' (adds the raw per-row deltas; query shapes that did not move are left out and counted in flat_entries, and canonical SQL is cut at 300 bytes ending in '…'). |
| window_minutes | number | Correlation window for matching planner/activity captures to each anchor (default 30). |
validate_queryBefore proposing or running any SQL: checks it against the snapshot and reports unknown tables, unknown columns on qualified references (t.col), and anti-patterns. When every unknown name has exactly one candidate it also returns corrected_sql -- the same query with those names replaced, re-validated -- so a misspelling comes back as a patch rather than prose. Needs no database connection and never executes the query. Names and shape only: not cost, not plan, not whether any rows match (advise, explain_query).| Parameter | Type | Description |
|---|---|---|
| sql * | string | SQL query. |
Security checks
- ✓README presentThe repository's README runs to about 1.5K words.
5 checks have not been run yet.
README
The repository's README runs to about 1.5K words. The original in the repository is authoritative.
Read full README