SchemaTongs Walkthrough — MariaDB
Point SchemaTongs at a MariaDB database, extract the live schema into structured JSON and SQL files, and explore the package ready for version control — the cast leg of the SchemaSmith cycle in 10 minutes.
By the SchemaSmith Team · Last reviewed
SchemaTongs grips your live schema and casts it into structured files.
Prerequisites
You need three things before starting the walkthrough — the SchemaSmith binaries, a MariaDB server you can read from, and the demo schema package this walkthrough drives.
SchemaSmith tools
Get the latest release from the downloads page.
A database server
Run the demo in containers if you have Docker and the .NET SDK, or on your own server if you already run MariaDB. The containers path uses the SchemaSmith repository's Docker Compose file, which starts the demo server for you. To use your own server, see the Use your own server section of the getting-started page, which shows how to deploy the demo databases onto it. If you do, use your own server address and login wherever the steps below show the demo's localhost:3317 and TestUser, and a renamed demo database's new name wherever they show northwind.
The demo files
Clone the whole repository at the release the downloads page serves, so the demo scripts match the tools you installed. The demo packages live under Demos/, but the helpers that stand them up live in the folders above them, so do not download one folder on its own:
git clone --branch v2.8.0 https://github.com/Schema-Smith/SchemaSmith.git
cd SchemaSmith
The checkout stays on the tagged release, so git prints a "detached HEAD" notice. That is expected and harmless for running the demo.
Step 1: Start the Demo Environment
Run this step to start the MariaDB demo in containers. If you deployed the demo databases onto your own server with the deploy-to-endpoint helper on the getting-started page, you already have what this step produces, so skip to Step 2.
Each platform has its own demo folder under Demos/ with a run-demo launcher, a docker-compose.yml, and a .env credentials file. From the repository root, launch the MariaDB demo:
cd Demos\MariaDB
run-demo.cmd
cd Demos/MariaDB
./run-demo.sh
The launcher runs build-schemaquench.cmd / .sh to compile the SchemaQuench binary (requires the .NET SDK on the host), then docker compose up --build packages that binary into a local Docker image, starts a MariaDB instance on port 3317, and deploys the demo databases using SchemaQuench. The launcher blocks until the completed service exits, which signals the databases are ready. Credentials live in Demos/MariaDB/.env:
| Setting | Value |
|---|---|
| MariaDB | localhost:3317 |
| User | TestUser |
| Password | (see Demos/MariaDB/.env) |
Step 2: Cast with SchemaTongs
Now let's go the other direction. Pretend you already have a database and want to bring it under SchemaSmith management. SchemaTongs grips your live schema and casts it into structured files.
From Demos/MariaDB/ (the folder Step 1 leaves you in, or the folder you ran the deploy-to-endpoint helper from), create a SchemaTongs configuration file called tongs-extract.json:
{
"Source": {
"Platform": "MariaDb",
"Server": "localhost",
"Port": "3317",
"User": "TestUser",
"Password": "your-password-here",
"Database": "northwind"
},
"Product": {
"Path": "./my-northwind",
"Name": "Northwind"
},
"Template": {
"Name": "Northwind"
},
"ShouldCast": {
"Tables": true,
"Functions": true,
"Views": true,
"Procedures": true,
"TableTriggers": true,
"Events": true
}
}
Run the extraction:
schematongs --ConfigFile:tongs-extract.json
Look at what appeared in the my-northwind/ folder. You now have a complete schema package:
my-northwind/
Product.json ← Platform, templates, tokens
.json-schemas/ ← JSON Schema validation, generated on the fly
Templates/
Northwind/
Template.json
Tables/
Categories.json
Customers.json
Orders.json
... (14 tables)
Views/
Alphabetical list of products.sql
...
Procedures/
CustOrderHist.sql
...
Functions/
Triggers/
Table Data/
One of those tables is recyclebin_Registry — part of the Northwind demo package itself, extracted like any other table in the database. Every table is a JSON file describing its columns, indexes, and constraints. Every stored procedure and view is a plain SQL file. This is your entire database — materialized as readable, diffable, reviewable source files. Commit this to source control and you have a complete history of every schema change from this point forward. For the full set of extraction options, see the SchemaTongs reference.
That's the cast. A live database, captured in files you can read, review, and version.
Step 3: Explore the Package
No GUI editor needed — the schema package is designed to read clearly in any editor or IDE. Open my-northwind/ in VS Code, JetBrains Rider, Visual Studio, or whatever your team uses. The .json-schemas/ folder gives you validation and autocomplete for every JSON file in the package automatically.
Click through Tables/Categories.json. You'll see the column definitions, the primary key, and any indexes. Open a stored procedure in Procedures/ and you see the full SQL definition ready to diff in a pull request. This is what schema review looks like when the files are designed for it: structured enough for tools, readable enough for humans, diff-friendly enough for code review.
Take a minute to click around. Every table, every view, every procedure in the Northwind database is here, structured and browsable. No server connection needed to explore.