|
|
|
@ -1,16 +1,25 @@
|
|
|
|
|
mod domain; |
|
|
|
|
|
|
|
|
|
use clap::Parser; |
|
|
|
|
use sqlx::sqlite::SqliteConnectOptions; |
|
|
|
|
use sqlx::sqlite::SqlitePoolOptions; |
|
|
|
|
use tracing_subscriber::fmt; |
|
|
|
|
use tracing_subscriber::prelude::*; |
|
|
|
|
use tracing_subscriber::EnvFilter; |
|
|
|
|
|
|
|
|
|
use crate::domain::options::Options; |
|
|
|
|
|
|
|
|
|
mod domain; |
|
|
|
|
|
|
|
|
|
#[tokio::main] |
|
|
|
|
async fn main() -> Result<(), sqlx::Error> { |
|
|
|
|
dotenv::dotenv().ok(); |
|
|
|
|
tracing_subscriber::registry() |
|
|
|
|
.with(fmt::layer()) |
|
|
|
|
.with(EnvFilter::from_default_env()) |
|
|
|
|
.init(); |
|
|
|
|
|
|
|
|
|
let options = Options::parse(); |
|
|
|
|
|
|
|
|
|
tracing::debug!("Migrating..."); |
|
|
|
|
let pool = SqlitePoolOptions::new() |
|
|
|
|
.connect_with( |
|
|
|
|
SqliteConnectOptions::new() |
|
|
|
@ -19,6 +28,6 @@ async fn main() -> Result<(), sqlx::Error> {
|
|
|
|
|
) |
|
|
|
|
.await?; |
|
|
|
|
sqlx::migrate!("./migrations").run(&pool).await?; |
|
|
|
|
print!("Hello world!"); |
|
|
|
|
tracing::debug!("Migration done."); |
|
|
|
|
Ok(()) |
|
|
|
|
} |
|
|
|
|