switched 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 18:18:03 by tomoron ### ########.fr */
|
||||
/* Updated: 2026/06/06 19:39:47 by tomoron ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -15,8 +15,6 @@ use minecraft::mc_socket_listen;
|
||||
|
||||
use diesel::{prelude::*, r2d2::{ConnectionManager, Pool}};
|
||||
|
||||
use std::env;
|
||||
|
||||
pub mod schema;
|
||||
pub mod models;
|
||||
|
||||
@ -33,7 +31,7 @@ pub use config::Config;
|
||||
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 database_url = "sqlite:///".to_string() + &Config::load().config_path + "/db.sqlite";
|
||||
|
||||
let manager = ConnectionManager::<SqliteConnection>::new(&database_url);
|
||||
Pool::builder()
|
||||
|
||||
Reference in New Issue
Block a user