| Crates.io | sir-eel |
| lib.rs | sir-eel |
| version | 0.1.0 |
| created_at | 2025-07-04 17:05:30.46935+00 |
| updated_at | 2025-07-04 17:05:30.46935+00 |
| description | A SurrealDB migration tool |
| homepage | https://github.com/DanOlson/sir-eel |
| repository | https://github.com/DanOlson/sir-eel |
| max_upload_size | |
| id | 1738222 |
| size | 2,705,094 |
Sir Eel is a lightweight and easy-to-use database migration tool for SurrealDB. It provides a simple CLI and programmatic API to help you manage your database schema changes.

Install the CLI using cargo:
cargo install sir-eel
initInitialize a sir-eel.toml configuration file in your project root.
sir-eel init
This will create a sir-eel.toml file with the following contents:
[sir-eel]
db_url = "rocksdb://data"
database = "mydatabase"
namespace = "mynamespace"
migrations_dir = "migrations"
Update the values in this file to reflect your needs. Note that the default persistence layer for SurrealDB supported by the CLI is RocksDB.
generateGenerate a new migration file.
sir-eel generate "create users table"
This will create a new file in the migrations_dir with a timestamp and
the provided name, e.g.,
migrations/20231027123456_create_users_table.surql.
migrateApply all pending migrations.
sir-eel migrate
You can also perform a dry run to see which migrations would be applied without actually running them:
sir-eel migrate --dry-run
Sir Eel can also be used programmatically in your Rust applications.
use sir_eel::{Config, Migrator};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let config = Config::builder()
.db_url("memory")
.database("test")
.namespace("test")
.migration_dir("migrations")
.build()?;
let migrator = Migrator::new(config).await?;
// Generate a new migration
migrator.generate("create_users")?;
// Run pending migrations
migrator.run().await?;
Ok(())
}
Migrator::new(config: Config): Creates a new Migrator instance.migrator.generate(name: &str): Generates a new migration file.migrator.run(): Runs all pending migrations.migrator.pending_migrations(): Returns a list of pending migrations.