SchemaSmith Documentation

Get Started with SchemaSmith

Free schema-as-code for SQL Server, PostgreSQL, and MySQL. The cycle is the same across all three; each walkthrough is hands-on and takes about 15 minutes.

Pick your platform
Developer running SchemaSmith from a terminal alongside JSON schema files

One workflow, three platforms

Schema management follows the same six-step cycle regardless of which database engine you're running: cast a live database into version-controlled files, review the structure, quench those files to a fresh database, declare the changes you want, preview the delta, and apply it. The tools that make this work — SchemaTongs for extraction, SchemaQuench for deployment — share identical concepts and mental models across SQL Server, PostgreSQL, and MySQL. What differs is the platform itself: the demo database pre-wired in the repository, the SQL dialect you read in the procedure files, and the data types you see in the column definitions.

Each platform has its own schema files and templates. The same mental model applies to all three, but a SchemaSmith package built for SQL Server is not a PostgreSQL package — every platform is managed separately, with platform-specific metadata and scripts. Pick the engine you're working with; you can come back and read the others whenever you want.

Pick your platform

Each walkthrough is self-contained and takes about 15 minutes. You can run one now and come back to the others later.

SQL Server

Work with the Northwind and Chinook demo databases. Extract a live SQL Server instance into JSON schema files and SQL procedure definitions, deploy the package to a fresh database, and apply a schema change by editing JSON.

PostgreSQL

Work with the Northwind and Sakila demo databases. Cast your schema into files, deploy to a clean PostgreSQL instance, and see how sequences, composite types, and enum types appear in the extracted package.

MySQL

Work with the Northwind and Chinook demo databases. Extract the schema, see how MySQL storage engines and collations are captured, quench a clean database from your files, and modify the schema through JSON declarations.

What you'll do in 15 minutes

Each walkthrough steps you through the complete SchemaSmith cycle in sequence. The steps are the same across all three platforms; the demo database and SQL dialect are the only platform-specific pieces.

  1. Start the demo. Spin up a Dockerized database server with a sample schema pre-loaded. A compose file in the repository does the work.
  2. Extract with SchemaTongs. Run a tool that connects to the live database, reads the complete schema, and materializes it as structured JSON files (for tables, columns, indexes) and plain SQL files (for views, stored procedures, functions).
  3. Explore the package. Open the extracted files in any editor. Tables become JSON. Procedures become SQL. No GUI required. Everything is human-readable and diff-friendly.
  4. Deploy with SchemaQuench. Point SchemaQuench at a clean, empty database. It reads your schema package and builds the entire database from the ground up: tables, indexes, constraints, views, and procedures, exactly as declared.
  5. Edit and preview. Modify a JSON file to add a new column. Run SchemaQuench in WhatIf mode (read-only) to see the computed SQL change before you apply it.
  6. Apply the change. Run SchemaQuench for real. It compares the declared state in your files against the live database, computes the exact DDL needed, and applies only that — nothing more, nothing less.