blob: 3d50b0f73472b045ed55582c2cf0a86e6357d205 (
plain) (
tree)
|
|
use crate::Modloader;
pub fn insert_mod(id: String, name: String, current_version: String, old_versions: Vec<String>, mod_loader: Modloader, desired_mc_version: String) -> Result<(), sqlite::Error> {
let connection = sqlite::open("./data.db").unwrap();
let loader = match mod_loader {
Modloader::Fabric => "fabric",
Modloader::Forge => "forge",
};
let sql = format!("INSERT INTO mods VALUES ('{}', '{}', '{}', '{}', '{}', '{}')", id, name, current_version, old_versions.join("|"), loader, desired_mc_version);
dbg!(&sql);
connection.execute(sql)
}
|