#sqlx #plugin #web #axum #spring-rs

spring-sqlx-migration-plugin

A plugin to run SQLx migrations automatically within the SpringRS framework

5 releases

0.2.4 Nov 17, 2024
0.2.3 Oct 20, 2024
0.2.2 Oct 14, 2024
0.2.1 Oct 12, 2024
0.2.0 Oct 12, 2024

#98 in #sqlx

Download history 328/week @ 2024-10-07 162/week @ 2024-10-14 130/week @ 2024-10-21 2/week @ 2024-10-28 46/week @ 2024-11-11 69/week @ 2024-11-18 13/week @ 2024-12-02

128 downloads per month

MIT license

5KB

Spring Sqlx Migration Plugin

crates.io

It's just a plugin to execute the migrations of Sqlx into SpringRS

Key Features:

  • Seamless integration with SpringRS
  • Automatically runs SQLx migrations on application startup
  • Supports various databases compatible with SQLx
  • Configurable and easy to use

Just add into the app.toml the initial config for this plugin:

[sqlx]
uri = "postgres://postgres:xudjf23adj213@127.0.0.1:5432"

[sqlx-migration]
migration_folder = "./migrations"

And into your main.rs

#[auto_config(WebConfigurator)] // auto config web router
#[tokio::main]
async fn main() {
    App::new()
        .add_plugin(SqlxPlugin) // Add plug-in
        .add_plugin(SqlxMigrationPlugin) // Add plug-in
        .add_plugin(WebPlugin)
        .run().await
}

Dependencies

~22–35MB
~563K SLoC