2023-04-13 08:15:55 +02:00
|
|
|
use std::str::FromStr;
|
|
|
|
|
2023-04-03 17:21:34 +02:00
|
|
|
use rot::rest;
|
2023-04-13 08:15:55 +02:00
|
|
|
use sqlx::{pool::PoolOptions, sqlite::SqliteConnectOptions, ConnectOptions};
|
2023-03-26 14:40:56 +02:00
|
|
|
|
2023-02-08 16:25:06 +01:00
|
|
|
#[macro_use]
|
|
|
|
extern crate rocket;
|
|
|
|
|
|
|
|
#[launch]
|
|
|
|
async fn rocket() -> _ {
|
2023-03-04 11:20:12 +01:00
|
|
|
env_logger::init();
|
2023-03-26 14:40:56 +02:00
|
|
|
|
2023-04-03 16:11:26 +02:00
|
|
|
//let pool = SqlitePool::connect(":memory:").await.unwrap();
|
2023-04-13 08:15:55 +02:00
|
|
|
let mut connection_options = SqliteConnectOptions::from_str("sqlite://db.sqlite").unwrap();
|
|
|
|
connection_options.log_statements(log::LevelFilter::Debug);
|
|
|
|
let pool = PoolOptions::new()
|
|
|
|
.connect_with(connection_options)
|
|
|
|
.await
|
|
|
|
.unwrap();
|
2023-04-03 16:11:26 +02:00
|
|
|
|
|
|
|
rest::start(pool)
|
2023-02-08 16:25:06 +01:00
|
|
|
}
|