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 installercurl -fsSL https://aureline.pixelscortex.com/install.sh | shWindows PowerShell
Open installerirm https://aureline.pixelscortex.com/install.ps1 | iexYou can also download release archives from GitHub releases.
You can also install the CLI with Cargo:
cargo install aureline-cliFor editor integrations, install the language server too:
cargo install aureline-lspThe 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.aurelineExpected success output:
OK: schema.aureline passed Aureline checks.4. Preview the diff
aureline migrate diffAureline compares the current schema against the latest migration snapshot, not against a live database.
5. Generate a migration
aureline migrate generate --name initThis 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.tomlThe 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-run7. Apply
aureline migrate applyAureline records applied migrations in the _aureline_migrations table and verifies checksums before running new migrations.