mirror of
https://git.ethanthesleepy.one/ethanaobrien/ew
synced 2025-10-09 00:47:19 +08:00
Correct placement of config.json file
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
use rusqlite::{Connection, params, ToSql};
|
||||
use std::sync::Mutex;
|
||||
use json::{JsonValue, array};
|
||||
use std::fs;
|
||||
|
||||
use crate::router::clear_rate::Live;
|
||||
|
||||
@@ -12,9 +11,7 @@ pub struct SQLite {
|
||||
|
||||
impl SQLite {
|
||||
pub fn new(path: &str, setup: fn(&SQLite)) -> SQLite {
|
||||
let args = crate::get_args();
|
||||
fs::create_dir_all(&args.path).unwrap();
|
||||
let conn = Connection::open(format!("{}/{}", args.path, path)).unwrap();
|
||||
let conn = Connection::open(crate::get_data_path(path)).unwrap();
|
||||
conn.execute("PRAGMA foreign_keys = ON;", ()).unwrap();
|
||||
let instance = SQLite {
|
||||
engine: Mutex::new(conn),
|
||||
|
Reference in New Issue
Block a user