One config spine across SchemaQuench, SchemaTongs, and DataTongs. File, environment, CLI — layered so CI can override a single value without touching the rest. Same contract for SQL Server, PostgreSQL, and MySQL.
By the SchemaSmith Team · Last reviewed
Every SchemaSmith CLI tool shares the same configuration spine — one consistent system for settings files, environment variables, and command-line switches.
SchemaSmith is flexible about how you pass switches — pick whichever style
feels natural. All switches accept either a double-dash (--) or
forward-slash (/) prefix. Separate the switch name from its value with
: or =. A single leading dash (-) also works.
--switch:value
--switch=value
/switch:value
-switch:value
Switch names are case-insensitive — --logpath,
--LogPath, and --LOGPATH all do the same thing.
Values that contain spaces must be quoted:
--ConfigFile:"C:\configs\my config.json"
/LogPath:"C:\My Logs\SchemaSmith"
Flags that take no value (like --version or --help) are
specified without a separator.
Every SchemaSmith CLI tool recognizes these switches. They're processed before any configuration is loaded.
| Switch | Aliases | Description |
|---|---|---|
--version |
-v, --ver |
Print the tool name and version number, then exit. |
--help |
-h, -? |
Print the available command-line switches, then exit. |
--ConfigFile:<path> |
Path to the settings file. Overrides the default <ToolName>.settings.json. |
|
--LogPath:<path> |
Directory for log files and backup subdirectories. Defaults to the tool's executable directory. See Log File Location for operational detail. | |
--ConnectionString:<connstr> |
Full ADO.NET / Npgsql / MySqlConnector connection string appropriate to the target platform. When provided, this bypasses all individual connection settings (Server, Port, User, Password, ConnectionProperties). |
# Deploy a schema package with a custom config and log directory
SchemaQuench --ConfigFile:production.json --LogPath:C:\Logs
# Extract a schema using a specific config
SchemaTongs --ConfigFile:extract-config.json
# Check which version is installed
SchemaQuench --version
# See available switches
SchemaTongs --help
For full --ConnectionString examples per platform, see
Connection Configuration below.
SchemaSmith layers configuration so you can set sensible defaults in a file and override just the pieces that change per environment. Later sources override earlier ones. The full chain, from lowest to highest priority:
<ToolName>.settings.jsonSmithySettings_--ConnectionString, --ConfigFile, --LogPathThis means a value set in the settings file can be overridden by an environment variable, and a CLI switch always wins.
Suppose your SchemaQuench.settings.json sets the server:
{
"Target": {
"Server": "dev-server"
}
}
You can override just the server for a single run using an environment variable:
$env:SmithySettings_Target__Server = "staging-server"
SchemaQuench
export SmithySettings_Target__Server=staging-server
SchemaQuench
Or override the entire connection from the command line:
SchemaQuench --ConnectionString:"Host=prod-server;\
Database=mydb;Username=deploy;Password=s3cret;"
The --ConnectionString switch bypasses all individual connection
settings — Server, Port, User,
Password, and ConnectionProperties are all ignored when a
full connection string is provided.
Each tool looks for its own settings file by name:
| Tool | Default settings file |
|---|---|
| SchemaQuench | SchemaQuench.settings.json |
| SchemaTongs | SchemaTongs.settings.json |
| DataTongs | DataTongs.settings.json |
The tool searches for the file in two locations, in order:
If the file is found in the current directory, that copy is used. If not, the tool falls back to the executable directory. If neither location has the file, the tool starts with an empty configuration (any required values must come from environment variables or CLI switches).
To use a different file entirely, pass the --ConfigFile switch:
SchemaQuench --ConfigFile:C:\configs\production.json
The path can be absolute or relative to the current working directory.
Environment variables give you a clean way to inject configuration without touching
files on disk — exactly what you need in CI/CD pipelines and containers. All
three tools read environment variables prefixed with SmithySettings_.
The prefix is stripped, and double underscores (__) map to hierarchy
separators in the configuration structure.
The prefix SmithySettings_ maps to the root of the config tree; each
__ becomes a : hierarchy separator. Example:
SmithySettings_Target__Server → Target:Server →
{ "Target": { "Server": "..." } }.
| Environment variable | Maps to config key |
|---|---|
SmithySettings_Target__Server | Target:Server |
SmithySettings_Target__Port | Target:Port |
SmithySettings_Target__User | Target:User |
SmithySettings_Target__Password | Target:Password |
SmithySettings_Target__ConnectionProperties__TrustServerCertificate | Target:ConnectionProperties:TrustServerCertificate |
SmithySettings_SchemaPackagePath | SchemaPackagePath |
SmithySettings_WhatIfONLY | WhatIfONLY |
SchemaTongs and DataTongs use Source instead of Target
for their connection section, so the equivalent variables start with
SmithySettings_Source__:
# SchemaQuench connection
$env:SmithySettings_Target__Server = "myserver"
$env:SmithySettings_Target__Password = "s3cret"
# SchemaTongs / DataTongs connection
$env:SmithySettings_Source__Server = "myserver"
$env:SmithySettings_Source__Password = "s3cret"
# SchemaQuench connection
export SmithySettings_Target__Server=myserver
export SmithySettings_Target__Password=s3cret
# SchemaTongs / DataTongs connection
export SmithySettings_Source__Server=myserver
export SmithySettings_Source__Password=s3cret
Environment variables are especially useful in CI/CD pipelines and containers where you don't want secrets in files on disk.
Each tool has one connection section. SchemaQuench uses a Target
section (it writes to the server), while SchemaTongs and DataTongs use a
Source section (they read from the server). The structure is the same
either way, and the same keys work for every supported platform — the adapter
under the hood routes the call to the right client library based on the product's
declared platform.
{
"Target": {
"Server": "myserver",
"Port": "",
"User": "deploy",
"Password": "s3cret",
"ConnectionProperties": {
"TrustServerCertificate": "True"
}
}
}
| Key | Purpose |
|---|---|
Server |
Database server hostname or IP address. |
Port |
TCP port. Leave blank for the platform default (SQL Server 1433, PostgreSQL 5432, MySQL 3306). |
User |
Login username. |
Password |
Login password. Masked in log output — see Startup Configuration Dump. |
Database |
Database name. Used by SchemaTongs and DataTongs. SchemaQuench reads its target databases from the schema package instead. |
ConnectionProperties |
Dictionary of additional connection string properties. Each key-value pair is appended to the built connection string. |
Platform-specific connection properties:
TrustServerCertificate, Encrypt, ApplicationIntent, etc.SslMode, Pooling, Timeout, etc. (Npgsql keys)SslMode, ConnectionTimeout, AllowPublicKeyRetrieval, etc. (MySqlConnector keys)
Whatever you put in ConnectionProperties is appended to the connection
string for that platform's client library. Consult the corresponding driver
documentation for the exhaustive list.
Instead of individual settings, you can provide a complete connection string for the target platform:
SchemaQuench --ConnectionString:"Data Source=myserver;\
Initial Catalog=mydb;User ID=sa;Password=s3cret;\
TrustServerCertificate=True;"
SchemaQuench --ConnectionString:"Host=myserver;Port=5432;\
Database=mydb;Username=deploy;Password=s3cret;"
SchemaQuench --ConnectionString:"Server=myserver;Port=3306;\
Database=mydb;User=deploy;Password=s3cret;"
When --ConnectionString is provided, all individual connection settings
(Server, Port, User, Password,
ConnectionProperties) are bypassed.
SQL Server only. Leave both User and Password blank and
the tool connects using the identity of the process. PostgreSQL and MySQL require
explicit credentials.
Your credentials stay out of the logs. When a tool logs its active configuration at startup — and when SchemaQuench logs its product and template script tokens — it scrubs any value whose name matches a built-in sensitive-name set, so a log is safe to attach to a support ticket, paste into a CI artifact, or drop into a screenshot.
The default sensitive-name patterns (case-insensitive, substring match) are Password, Pwd, Secret, ApiKey, Token, ConnectionString, and Credential. A matched value renders as *** while its name still prints, so you can confirm the setting exists without exposing it. An embedded Password= / Pwd= inside a connection-string value is stripped even when the surrounding setting or token is not sensitively named — one leaked connection string is one too many.
All other values are logged as-is, so you can still audit the active configuration from the log.
Configuration:
Server: myserver
Port: 5432
User: deploy
Password: ***
ConnectionProperties:
SslMode: Prefer
An optional LogHygiene block in any tool's *.settings.json tunes the behavior. With no block present, the defaults above apply.
"LogHygiene": {
// Suppress the token-logging section entirely -- one notice line, no token
// names and no values. For products with hundreds of tokens. Default: true.
"LogTokens": true,
// Scrub these exact token names too, beyond the default patterns.
"ScrubTokens": [ "Handshake", "TenantSeed" ],
// Scrub names matching these extra patterns (contains-match; the * is optional).
"ScrubPatterns": [ "*Salt*", "*PrivateKey*" ],
// Opt a false positive back out -- log this name verbatim even though it
// matches a default pattern (e.g. a column literally named "Token").
"AllowTokens": [ "PublicToken" ]
}
When a token name appears in both AllowTokens and a scrub rule, AllowTokens wins and the value is logged verbatim — but an embedded connection-string password is still stripped.
When any script fails during a SchemaQuench deployment — a user-authored script, a generated table-quench procedure, or a data-delivery merge — SchemaQuench writes the exact token-expanded SQL the server rejected to a re-runnable .sql artifact file. The progress log tells you where:
Unable to quench 'Before/01-seed-config.sql': Invalid column name 'Region'.
Resolved SQL written to: C:\deploy\SchemaQuench - Failed 01-seed-config prod-db.TargetDB.sql
For generated procedures, the same file also appears in the Debug Script: log line when the procedure throws:
FAILED to quench: ...
Debug Script: 'C:\deploy\SchemaQuench - Quench Missing Tables And Columns prod-db.TargetDB.sql'
Both shapes point to the same kind of artifact: a .sql file with a comment header (server/database/schema, the failing script name, the error message), every batch the engine received, separated by GO, with the last-attempted batch marked -- >>> FAILING BATCH (#N) >>>. The failing-batch marker is a best-effort hint — the engine marks the last batch it attempted, which is usually the one that caused the error.
Artifacts are raw by default — all token values are already expanded to their real values, so you can open the file, connect to the target, and reproduce the failure immediately without any further substitution.
Artifacts land in the ArtifactPath directory (default: current working directory), not the log directory. This is intentional: raw artifacts may contain expanded sensitive values and should not be automatically swept into log archives or CI artifacts.
Directory where SchemaQuench writes resolved-SQL failure artifacts and generated-SQL debug files.
{ "ArtifactPath": "C:\\deploy\\debug" }
| Default | Behavior |
|---|---|
| (not set) | Artifacts land in the current working directory (where SchemaQuench was launched). |
| A directory path | Artifacts land in the specified directory. Relative paths are resolved from the current working directory. |
Setting ArtifactPath is useful when you want artifacts in a consistent location regardless of where SchemaQuench is invoked — a CI agent's workspace directory, for example, or a dedicated debug folder outside the log path. The directory is created automatically if it does not exist.
Controls whether sensitive values are redacted in failure artifacts before writing.
{ "ScrubArtifacts": true }
| Value | Behavior |
|---|---|
false (default) | Artifacts contain real expanded values. Re-runnable immediately — open in a query tool and reproduce the failure without restoring secrets. |
true | Sensitive token values (names matching *Password*, *Secret*, *ApiKey*, *Token*, etc., per LogHygiene rules) and inline connection-string passwords are redacted to ***. Safe to attach to a CI artifact or support ticket. To reproduce, restore the real values first. |
Leave ScrubArtifacts off for local debugging — raw artifacts are immediately re-runnable. Turn it on for CI environments or when attaching an artifact to a support ticket. For a step-by-step walkthrough of working a failed deployment from artifact to fix, see Logging.
When SchemaQuench runs one of its generated procedures against your target database, it dumps the exact SQL it sent to a companion .sql file. If the procedure throws, the progress log surfaces the file path via Debug Script:. Open it in your query tool of choice, re-run the SQL by hand, and reproduce or narrow the problem without guessing what SchemaSmith actually executed.
Generated procedures cover missing tables and columns, modified tables, indexes, foreign keys, materialized views, indexed views, and the table-JSON parse step. Debug files follow the pattern SchemaQuench - <operation> <server>.<database>.sql:
SchemaQuench - Quench Missing Tables And Columns prod-db.NorthwindClone.sql
SchemaQuench - Quench Modified Tables prod-db.NorthwindClone.sql
SchemaQuench - Quench Indexes prod-db.NorthwindClone.sql
SchemaQuench - Quench Foreign Keys prod-db.NorthwindClone.sql
SchemaQuench - Quench Materialized Views prod-db.NorthwindClone.sql
SchemaQuench - Quench Indexed Views prod-db.NorthwindClone.sql
SchemaQuench - Parse Table Json prod-db.NorthwindClone.sql
Each run overwrites the debug files for the operations it actually performed. Operations that don't apply to your platform (for example, indexed views on PostgreSQL or materialized views on MySQL) produce no file. Debug files land in the ArtifactPath directory (default: current working directory); --LogPath controls the progress and error logs, not artifact or debug SQL.
SchemaSmith removes database objects that no longer appear in the schema package — drop-by-absence — under a family of flags. Each composes across tiers — environment → product → template — with the environment tier living here in SchemaQuench.settings.json as a deployment-wide guardrail, independent of any package. The column, foreign-key, check-constraint, exclude-constraint, statistics, and index flags add a fourth, per-table tier; DropTablesRemovedFromProduct and DropUnknownIndexes stop at the template tier.
| Setting | Default | Applies to |
|---|---|---|
DropTablesRemovedFromProduct | true | All platforms |
DropColumnsRemovedFromProduct | true | All platforms |
DropForeignKeysRemovedFromProduct | true | All platforms |
DropCheckConstraintsRemovedFromProduct | true | Table-level checks, all platforms |
DropExcludeConstraintsRemovedFromProduct | true | PostgreSQL only |
DropStatisticsRemovedFromProduct | true | SQL Server + PostgreSQL |
DropIndexesRemovedFromProduct | true | Product-owned indexes, all platforms |
DropUnknownIndexes | false | Out-of-band indexes, all platforms |
Each flag is also settable as an environment variable using the standard prefix — SmithySettings_<FlagName>, for example SmithySettings_DropUnknownIndexes.
A false at any tier is sticky: it locks the effective value to false for all lower tiers and cannot be re-enabled by a more-specific setting. Absent inherits from the tier above; a true at a lower tier overrides an inherited true but never an ancestor's explicit false. For the flags that expose a per-table tier, a table's own .json can only tighten (set its own false to protect its objects); it can never re-enable a drop a higher tier suppressed.
The environment tier for DropUnknownIndexes is new in this release — previously it was settable only in Product.json and Template.json. Its default is false at every tier, so index-drop-by-absence stays off unless you opt in. For what each flag governs, the recyclebin-friendly removal pattern, and per-platform behavior, see Drop control and the SchemaQuench reference.
SchemaSmith records a content-hash stamp of the helper procedures and tables it installs in each target database, and skips the re-install on later runs when nothing has changed — so a normal deployment pays the install cost only when the tooling actually moves. ForceReKindle (default false) overrides that skip and re-installs the helper objects unconditionally — handy after a manual edit to the helpers, when diagnosing a deploy problem, or any time you want a known-good baseline regardless of stamp state.
Set it in SchemaQuench.settings.json, or pass --ForceReKindle on the command line (presence enables it, no value needed); when both are present the CLI switch wins. If you can't change the configuration or CLI invocation, dropping the SchemaSmith.KindleStamp marker table (SchemaSmith_KindleStamp on MySQL) has the same effect — the gate sees the missing stamp on the next run and re-installs.
SchemaQuench can narrow a run to a subset of its targets without editing the package. The Target block takes Templates, Databases, and Schemas arrays that filter the discovered universe (the three dimensions AND together); TemplateTargets overrides discovery per template and can provision missing databases or schemas via CreateIfMissing. Both live in SchemaQuench.settings.json — see the SchemaQuench reference for the full behavior.
Common invocation patterns for the scenarios above. Copy, paste, adjust the server and credential values for your target.
# Run with defaults (settings file in current directory or tool directory)
SchemaQuench
# Custom config file
SchemaQuench --ConfigFile:staging.json
# Custom log directory
SchemaQuench --LogPath:C:\Logs\quench
# Override connection via environment
$env:SmithySettings_Target__Server = "prod-db"
$env:SmithySettings_Target__User = "deploy"
$env:SmithySettings_Target__Password = "s3cret"
SchemaQuench
# Override connection via CLI (platform-appropriate connection string)
SchemaQuench --ConnectionString:"Host=prod-db;`
Database=mydb;Username=deploy;Password=s3cret;"
# Force a full helper re-kindle (re-install SchemaSmith objects)
SchemaQuench --ForceReKindle
# Environment guardrail: never drop unknown indexes
$env:SmithySettings_DropUnknownIndexes = "false"
# Run with defaults (settings file in current directory or tool directory)
SchemaQuench
# Custom config file
SchemaQuench --ConfigFile:staging.json
# Custom log directory
SchemaQuench --LogPath:/var/log/quench
# Override connection via environment
export SmithySettings_Target__Server=prod-db
export SmithySettings_Target__User=deploy
export SmithySettings_Target__Password=s3cret
SchemaQuench
# Override connection via CLI (platform-appropriate connection string)
SchemaQuench --ConnectionString:"Host=prod-db;\
Database=mydb;Username=deploy;Password=s3cret;"
# Force a full helper re-kindle (re-install SchemaSmith objects)
SchemaQuench --ForceReKindle
# Environment guardrail: never drop unknown indexes
export SmithySettings_DropUnknownIndexes=false
Wire SchemaSmith into a CI/CD pipeline, with environment variables for credentials and settings files for defaults.
Start the CI/CD lab