SchemaSmith Documentation

External Tools

Run SchemaSmith applications against live databases — extract schemas, deploy changes with safe dry-run defaults, and extract reference data for population.

By the SchemaSmith Team · Last reviewed

Ask Forge External Tools

Tools that execute SchemaSmith CLI tools as subprocesses.

The External Tier

Ask Forge's 3 Tier 4 (External) tools run the SchemaSmith command-line applications — SchemaTongs, SchemaQuench, and DataTongs — as subprocesses. This is the only tier that connects to a live database.

They require the Operator trust level (the only level that unlocks them), a configured database connection, and the SchemaSmith binaries installed — on your PATH or pointed to by the SchemaSmithPath environment variable. Each tool resolves a single SchemaSmith binary that works across SQL Server, PostgreSQL, and MySQL.

Every run is confirmation-gated: through the MCP server each call must pass confirm: true, and in the CLI you approve interactively (or pass --yes for scripted runs).

SchemaTongs

Extract a live database's complete schema — tables, columns, indexes, constraints, and foreign keys — into SchemaSmith JSON.

run-schema-tongs MCP: schemasmith_run_schema_tongs

Run SchemaTongs to reverse-engineer a live database into organized SchemaSmith JSON templates. Requires a configured connection; confirmation-gated.

Parameters: --database (required unless supplied by the connection) — Database to extract. --platform (optional)SqlServer, PostgreSQL, or MySQL (auto-detected from context). --output-path (optional) — Output directory (default: product path or working directory). --product-name (required for a fresh directory). --template-name (optional, default: database name). --object-filter (optional) — Comma-separated schema.name objects to extract. --exclude-types (optional) — Object types to skip. --log-path (optional, default output_path/Logs). --config-file (optional) — Use an existing SchemaTongs.settings.json. SQL Server also accepts --script-dynamic-dependency-removal.

Example:

ask-forge run-schema-tongs --database AdventureWorks \
  --platform SqlServer --output-path ./AdventureWorks \
  --product-name AdventureWorks

SchemaQuench

Apply your schema package to a target database, reconciling the live database to your JSON definitions — preview-first by default.

run-schema-quench MCP: schemasmith_run_schema_quench

Run SchemaQuench to compare your JSON definitions against the live database and run the DDL needed to reconcile them. Defaults to a dry-run (WhatIf) preview — pass --dry-run false to apply changes for real. Requires a configured connection and a loaded product and template; confirmation-gated.

Parameters: --template (optional) — Template to apply (default: context template). --dry-run (optional) — Preview only; defaults to true. --platform (optional) — Auto-detected from context. --log-path (optional, default product_path/Logs). --resume (optional) — Resume from the last checkpoint. --script-tokens (optional) — JSON object of token overrides. --options (optional) — JSON of advanced options (max_threads, deliver_data, drop_removed_tables, and more). --config-file (optional) — Use an existing SchemaQuench.settings.json.

Example:

# Dry-run preview (the default — applies nothing)
ask-forge run-schema-quench --template AdventureWorks \
  --platform SqlServer

Rehearse before you apply

Because run-schema-quench runs in dry-run (WhatIf) mode by default, you can rehearse a deployment against a real database and read the full plan without changing anything. Apply for real only once the preview looks right, by adding --dry-run false.

DataTongs

Extract reference and seed data from a live database into JSON content files and MERGE scripts for population during deployment.

run-data-tongs MCP: schemasmith_run_data_tongs

Run DataTongs to extract table data into JSON content files and MERGE scripts suitable for seed/reference-data delivery during a SchemaQuench deployment. Requires a configured connection and at least one table; confirmation-gated.

Parameters: --database (required unless supplied by the connection). --platform (optional) — Auto-detected from context. --tables (required unless --config-file is used) — JSON array of table configs; each needs name, plus optional keyColumns, selectColumns, filter, mergeType. --script-path (optional) — MERGE-script output directory. --content-path (optional) — Content-JSON output directory. --merge-type (optional)Insert, Insert/Update, or Insert/Update/Delete. --options (optional) — JSON of advanced options. --config-file (optional) — Use an existing DataTongs.settings.json.

Example:

ask-forge run-data-tongs --database AdventureWorks \
  --platform SqlServer \
  --tables '[{"name":"Production.UnitMeasure",
    "keyColumns":"UnitMeasureCode"}]'

Tool Documentation

Each tool ships as a single SchemaSmith binary that works across SQL Server, PostgreSQL, and MySQL. For the full command-line reference — every flag, setting, and example — see the standalone tool docs.

SchemaTongs

Extract a live database's schema into SchemaSmith JSON.

Read the docs

SchemaQuench

Deploy a schema package to a target database.

Read the docs

DataTongs

Extract reference and seed data into content files and MERGE scripts.

Read the docs