start switch to sqlite
This commit is contained in:
@ -6,7 +6,7 @@
|
||||
/* By: tomoron <tomoron@student.42angouleme.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2026/05/29 21:22:17 by tomoron #+# #+# */
|
||||
/* Updated: 2026/06/06 15:37:52 by tomoron ### ########.fr */
|
||||
/* Updated: 2026/06/06 18:18:03 by tomoron ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -22,18 +22,20 @@ pub mod models;
|
||||
|
||||
pub mod status;
|
||||
|
||||
pub mod docker;
|
||||
|
||||
mod cli;
|
||||
use cli::*;
|
||||
|
||||
mod config;
|
||||
pub use config::Config;
|
||||
|
||||
pub type DbPool = Pool<ConnectionManager<PgConnection>>;
|
||||
pub type DbPool = Pool<ConnectionManager<SqliteConnection>>;
|
||||
|
||||
fn get_connection_pool() -> DbPool {
|
||||
let database_url = env::var("DATABASE_URL").expect("DATABASE_URL must be set");
|
||||
|
||||
let manager = ConnectionManager::<PgConnection>::new(&database_url);
|
||||
let manager = ConnectionManager::<SqliteConnection>::new(&database_url);
|
||||
Pool::builder()
|
||||
.build(manager)
|
||||
.unwrap_or_else(|_| panic!("Error creating pool for {}", database_url))
|
||||
|
||||
Reference in New Issue
Block a user