refactor!: change migration tool to sqlx

This commit is contained in:
Alexander Navarro 2025-04-15 15:18:20 -04:00
parent 27037a9f75
commit 49c8682164
15 changed files with 30 additions and 894 deletions

View file

@ -31,6 +31,9 @@ pub enum Error {
#[error(transparent)]
DatabaseOperation(#[from] sqlx::Error),
#[error(transparent)]
Migration(#[from] sqlx::migrate::MigrateError),
#[error(transparent)]
Config(#[from] figment::Error),

View file

@ -38,6 +38,8 @@ async fn main() -> Result<()> {
.connect(&config.db.generate_db_string(false)?)
.await?;
sqlx::migrate!("./migrations").run(&pool).await?;
let (tx_state, tx_layer) = Tx::setup(pool);
let app = router::new()