Aureline

Getting Started

Create a schema, validate it, generate a migration, and apply it.

This guide covers the currently supported path: schema authoring through migrations.

Install Aureline

Install the prebuilt CLI with the hosted installers, then copy the command for your platform:

macOS / Linux

Open installer
curl -fsSL https://aureline.pixelscortex.com/install.sh | sh

Windows PowerShell

Open installer
irm https://aureline.pixelscortex.com/install.ps1 | iex

You can also download release archives from GitHub releases.

You can also install the CLI with Cargo:

cargo install aureline-cli

For editor integrations, install the language server too:

cargo install aureline-lsp

The Zed extension can also run cargo install aureline-lsp automatically when it cannot find aureline-lsp on PATH, but installing it yourself first makes startup faster and clearer.

1. Create schema.aureline

table User schemafull {
  email string @unique
}

2. Optional configuration

Create aureline.toml if you do not want to use defaults.

[schema]
file = "schema.aureline"

[migrations]
dir = "migrations"

3. Check the schema

aureline check schema.aureline

Expected success output:

OK: schema.aureline passed Aureline checks.

4. Preview the diff

aureline migrate diff

Aureline compares the current schema against the latest migration snapshot, not against a live database.

5. Generate a migration

aureline migrate generate --name init

This creates files similar to:

migrations/0001_init/migration.surql
migrations/0001_init/down.surql
migrations/meta/0001_snapshot.json
migrations/meta/_journal.json
migrations/migration_lock.toml

The generated migration.surql includes:

DEFINE TABLE user SCHEMAFULL;
DEFINE FIELD email ON user TYPE string;
DEFINE INDEX user_email_unique ON user FIELDS email UNIQUE;

6. Dry-run apply

aureline migrate apply --dry-run

7. Apply

aureline migrate apply

Aureline records applied migrations in the _aureline_migrations table and verifies checksums before running new migrations.

On this page