use crate::Modloader; pub fn insert_mod(id: String, name: String, current_version: String, old_versions: Vec, 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) }