deadpool, diesel and errors! #16
1 changed files with 4 additions and 4 deletions
|
@ -2,6 +2,7 @@ use actix_cors::Cors;
|
||||||
use actix_web::{App, HttpServer, web};
|
use actix_web::{App, HttpServer, web};
|
||||||
use argon2::Argon2;
|
use argon2::Argon2;
|
||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
|
use error::Error;
|
||||||
use simple_logger::SimpleLogger;
|
use simple_logger::SimpleLogger;
|
||||||
use diesel_async::pooled_connection::AsyncDieselConnectionManager;
|
use diesel_async::pooled_connection::AsyncDieselConnectionManager;
|
||||||
use diesel_async::pooled_connection::deadpool::Pool;
|
use diesel_async::pooled_connection::deadpool::Pool;
|
||||||
|
@ -18,8 +19,7 @@ mod api;
|
||||||
pub mod structs;
|
pub mod structs;
|
||||||
pub mod utils;
|
pub mod utils;
|
||||||
pub mod schema;
|
pub mod schema;
|
||||||
|
pub mod error;
|
||||||
type Error = Box<dyn std::error::Error>;
|
|
||||||
|
|
||||||
#[derive(Parser, Debug)]
|
#[derive(Parser, Debug)]
|
||||||
#[command(version, about, long_about = None)]
|
#[command(version, about, long_about = None)]
|
||||||
|
@ -66,9 +66,9 @@ async fn main() -> Result<(), Error> {
|
||||||
|
|
||||||
let mut conn = AsyncConnectionWrapper::<diesel_async::AsyncPgConnection>::establish(&database_url)?;
|
let mut conn = AsyncConnectionWrapper::<diesel_async::AsyncPgConnection>::establish(&database_url)?;
|
||||||
|
|
||||||
conn.run_pending_migrations(MIGRATIONS);
|
conn.run_pending_migrations(MIGRATIONS)?;
|
||||||
Ok::<_, Box<dyn std::error::Error + Send + Sync>>(())
|
Ok::<_, Box<dyn std::error::Error + Send + Sync>>(())
|
||||||
}).await?;
|
}).await?.unwrap();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
**Stored for later possible use**
|
**Stored for later possible use**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue