Dynamic Schema

The Dynamic Schema

The core philosophy of Saint CMS is that you should never have to manually write SQL migration files.

Saint uses a “Config-First” architecture. Your entire database structure is driven by a single JSON file: saint.config.json.

How It Works

When you use the Next.js Studio to create a new collection (like “Blog Posts” or “Products”), the Studio updates the saint.config.json file.

The Go engine constantly watches this file. The millisecond it detects a change, it parses the JSON and automatically runs SQLite ALTER TABLE commands to perfectly sync your database.

Example Configuration

Here is what a standard config file looks like under the hood. Notice the localized flag on the text fields:

saint.config.json
{
  "collections": [
    {
      "name": "product",
      "fields": [
        { "name": "title", "type": "string", "localized": true },
        { "name": "description", "type": "text", "localized": true },
        { "name": "price", "type": "number" },
        { "name": "in_stock", "type": "boolean" }
      ]
    }
  ]
}

Smart Schema Features

Because Saint CMS reads your configuration file dynamically, it automatically grants superpowers to your fields based on their type:

Native Localization (i18n)

By adding "localized": true to any string or text field, the Next.js Studio will automatically generate EN | FR | ES language tabs for that specific field. The Go engine will safely package these translations into a single database row, keeping your architecture clean.

You don’t need to configure search manually. The Go Auto-Migrator scans your config file. If it finds any field with the type string or text, it automatically builds and updates a shadow SQLite FTS5 Virtual Table in the background, making that field instantly searchable via the Public API.