SchemaSmith Documentation

Configuration

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.

Configuration

Every SchemaSmith CLI tool shares the same configuration spine — one consistent system for settings files, environment variables, and command-line switches.

CLI Switch Format

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.

Common Switches

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, edition, 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).

Examples

# 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.

Configuration Hierarchy

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:

  1. Settings file<ToolName>.settings.json
  2. User secrets — .NET user secrets (debug builds only, not present in release builds)
  3. Environment variables — prefixed with SmithySettings_
  4. CLI switches--ConnectionString, --ConfigFile, --LogPath

This means a value set in the settings file can be overridden by an environment variable, and a CLI switch always wins.

Override example

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.

Settings Files

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:

  1. The current working directory (where you run the command)
  2. The tool's executable directory (where the binary lives)

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

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.

Mapping rules

The prefix SmithySettings_ maps to the root of the config tree; each __ becomes a : hierarchy separator. Example: SmithySettings_Target__ServerTarget:Server{ "Target": { "Server": "..." } }.

Environment variable Maps to config key
SmithySettings_Target__ServerTarget:Server
SmithySettings_Target__PortTarget:Port
SmithySettings_Target__UserTarget:User
SmithySettings_Target__PasswordTarget:Password
SmithySettings_Target__ConnectionProperties__TrustServerCertificateTarget:ConnectionProperties:TrustServerCertificate
SmithySettings_SchemaPackagePathSchemaPackagePath
SmithySettings_WhatIfONLYWhatIfONLY

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.

Connection Configuration

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.

Individual connection settings

{
    "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:

  • SQL ServerTrustServerCertificate, Encrypt, ApplicationIntent, etc.
  • PostgreSQLSslMode, Pooling, Timeout, etc. (Npgsql keys)
  • MySQLSslMode, 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.

Full connection string override

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.

Windows authentication

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.

Quick Reference

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:/var/log/quench

# Override connection via environment (macOS / Linux)
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;"

Windows readers: for the PowerShell equivalent of the export block, see Environment Variables.

Last reviewed May 2026 by the SchemaSmith Team.