Macro generate_migration

Source
generate_migration!() { /* proc-macro */ }
Expand description

Re-export the Model macro for convenience Macro to generate migration from a model

Creates a migration instance from a model’s schema definition. The migration will contain the SQL necessary to create the table for the model.

§Examples:

use libsql_orm::{generate_migration, MigrationManager};

// Generate migration for User model
let user_migration = generate_migration!(User);

// Execute the migration
let manager = MigrationManager::new(db);
manager.execute_migration(&user_migration).await?;