SchemaSmith Documentation

External Tools

4 tools for executing SchemaSmith applications against live databases.

Ask Forge External Tools

Operator Trust Level

Tier 4 tools execute external SchemaSmith applications — SchemaTongs, SchemaQuench, and DataTongs — through the Ask Forge interface. These tools interact with live databases for schema extraction, deployment, and data extraction.

Because these tools connect to real databases, they require the Operator trust level. Every execution prompts for confirmation before running (controlled by the confirmTier4 setting). They also require that the corresponding SchemaSmith binaries are installed and their paths are configured.

Operator trust level includes all Tier 1, 2, and 3 capabilities.

SchemaTongs — Schema Extraction

run-schema-tongs MCP: forge_run_schema_tongs

Extract schema from a live database into SchemaSmith JSON format. SchemaTongs reads catalog metadata (tables, columns, indexes, constraints, foreign keys) and writes the extracted schema as organized packages and templates.

Requires confirmation before execution. Use --yes to skip in CLI mode.

Parameters

Parameter Type Description
--databasestringDatabase name (overrides the value from the saved connection)
--output-pathstringOutput directory for extracted schema (default: current product path or working directory)
--object-filterstringComma-separated list of specific objects to extract (schema.name or just name). Filters any object type, not just tables
--platformstringDatabase platform: MSSQL, MySQL, or PostgreSQL (auto-detected from context if not specified)
--product-namestringProduct name for new extractions (required when extracting to a fresh directory)
--template-namestringTemplate name for new extractions (default: database name)
--log-pathstringDirectory for log files (default: output_path/Logs)

Object Type Flags

Control which object types are extracted. All default to true unless noted.

Parameter Default Description
--extract-tablestrueExtract tables
--extract-viewstrueExtract views
--extract-procedurestrueExtract stored procedures
--extract-functionstrueExtract user-defined functions
--extract-triggerstrueExtract triggers
--extract-schemastrueExtract schemas

MSSQL-Specific Flags

Parameter Default Description
--extract-typestrueExtract user-defined types
--extract-catalogsfalseExtract full-text catalogs
--extract-stoplistsfalseExtract stop lists
--extract-ddl-triggersfalseExtract DDL triggers
--extract-xml-schemasfalseExtract XML schema collections
--script-dynamic-dependency-removalfalseScript dynamic dependency removal for functions (drops computed column dependencies before function updates)

MySQL-Specific Flags

Parameter Default Description
--extract-eventstrueExtract scheduled events

PostgreSQL-Specific Flags

Parameter Default Description
--extract-domain-typestrueExtract domain types
--extract-enum-typestrueExtract enum types
--extract-composite-typestrueExtract composite types
--extract-aggregatestrueExtract aggregate functions
--extract-sequencestrueExtract sequences
--extract-rulestrueExtract rules

Example:

ask-forge run-schema-tongs --platform mssql \
  --product-name MyProduct

Returns: Extraction progress, summary of extracted objects (table count, index count, etc.), and the output directory path.

Platforms: Available for SQL Server, PostgreSQL, and MySQL — each with a platform-specific binary.

SchemaQuench — Schema Deployment

run-schema-quench MCP: forge_run_schema_quench

Apply schema JSON to a target database. SchemaQuench reads your SchemaSmith JSON definitions, compares them against the current database state, and generates and executes the DDL needed to bring the database in line. Defaults to dry-run mode — set --dry-run false to apply changes for real.

Requires confirmation before execution. Use --yes to skip in CLI mode.

Parameters

Parameter Type Default Description
--templatestringcurrentTemplate to apply
--dry-runbooleantruePreview changes without applying (default: true for safety)
--platformstringDatabase platform: MSSQL, MySQL, or PostgreSQL (auto-detected from context if not specified)
--log-pathstringDirectory for log files (default: product_path/Logs)
--max-threadsinteger10Parallel execution threads (1–20)
--run-scripts-twicebooleanfalseRun scripts twice for dependency resolution
--drop-removed-tablesbooleanfalseDrop tables not in schema product
--update-tablesbooleantrueUpdate existing tables
--kindle-forgebooleantrueExecute pre/post scripts
--deliver-databooleantrueApply data scripts
--checkpoint-dirstringCheckpoint directory for resume capability (defaults to log_path)
--resumebooleanfalseResume from last checkpoint instead of starting fresh

MSSQL-Specific Flags

Parameter Type Description
--verbosebooleanEnable verbose logging (include PRINT messages in output)
--secondary-serversstringComma-separated list of secondary servers in availability group to update (e.g., SQL Agent jobs)

Example:

ask-forge run-schema-quench --platform mssql

Returns: Deployment progress, list of applied changes, and success/failure status for each operation.

Platforms: Available for SQL Server, PostgreSQL, and MySQL — each with a platform-specific binary.

DataTongs — Data Extraction

run-data-tongs MCP: forge_run_data_tongs

Extract table data from a database to JSON content files and MERGE scripts. DataTongs reads from the target database and produces files suitable for data population during SchemaQuench deployments.

Requires confirmation before execution. Use --yes to skip in CLI mode.

Parameters

Parameter Type Default Description
--databasestringDatabase name (overrides the value from the saved connection)
--platformstringDatabase platform: MSSQL, MySQL, or PostgreSQL (auto-detected from context if not specified)
--script-pathstringOutput directory for MERGE SQL scripts (default: working directory)
--content-pathstringOutput directory for table content JSON files (default: working directory)
--log-pathstringDirectory for log files (default: script_path/Logs)
--tablesstringJSON array of table configurations (see below)
--output-content-filesbooleanfalseGenerate .tabledata JSON files containing table contents
--output-scriptsbooleantrueGenerate SQL MERGE scripts for data population
--tokenize-scriptsbooleanfalseReplace JSON content in scripts with named tokens for deferred data loading
--disable-triggersbooleanfalseDisable triggers during merge operations
--merge-updatebooleantrueInclude UPDATE logic in MERGE statements for existing rows
--merge-deletebooleanfalseInclude DELETE logic in MERGE statements for rows not in source

PostgreSQL-Specific Flags

Parameter Type Default Description
--disable-rulesbooleanfalseDisable rules during merge operations
--update-descendentsbooleantrueUpdate descendent tables during merge

Table Configuration Format

The --tables parameter accepts a JSON array. Only name is required per entry.

Property Required Description
nameYesTable name in schema.table format (e.g., dbo.Users)
keyColumnsNoComma-separated key columns for MERGE matching
selectColumnsNoComma-separated columns to extract (default: all columns)
filterNoSQL WHERE clause to filter extracted rows

Example:

ask-forge run-data-tongs \
  --tables '[{"name":"dbo.Users","keyColumns":"UserId"},{"name":"dbo.Roles"}]'

Returns: Extraction progress and the output file paths for generated scripts and content files.

Platforms: Available for SQL Server, PostgreSQL, and MySQL — each with a platform-specific binary.

View Log — Log Viewing

view-log MCP: forge_view_log

View or open external tool log files. After running SchemaTongs, SchemaQuench, or DataTongs, use this tool to inspect progress and error logs without leaving the Ask Forge interface.

Parameters

Parameter Type Required Description
--log-pathstringYesPath to the log file to view
--tail-linesintegerNoNumber of lines to return from end of file (default: 50)
--open-externalbooleanNoOpen log file in system text editor instead of returning content

Example:

ask-forge view-log \
  --log-path ./Logs/"SchemaQuench - Errors.log" \
  --tail-lines 200

Returns: Log file contents (tail), or opens the file in your default text editor if --open-external is set.

Platform Tool Documentation

Each platform has its own documentation for SchemaTongs, SchemaQuench, and DataTongs. These pages cover platform-specific options, connection strings, and usage details.

SQL Server — Community
SQL Server — Enterprise
PostgreSQL — Enterprise
MySQL — Enterprise