From ea50af892c4268ae06f6df40ee435eadd076228d Mon Sep 17 00:00:00 2001 From: fxqnlr Date: Sun, 6 Nov 2022 23:06:54 +0100 Subject: halfswitch to rusqlite; db tests --- src/commands/setup.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/commands/setup.rs') diff --git a/src/commands/setup.rs b/src/commands/setup.rs index 0223a21..0940959 100644 --- a/src/commands/setup.rs +++ b/src/commands/setup.rs @@ -1,6 +1,6 @@ use std::{fs::File, path::Path, io::{Error, ErrorKind}}; -use crate::{config::Cfg, db::{db_setup, get_dbversion, create_dbversion, insert_column, get_lists, get_list, get_current_versions, insert_dl_link}, modrinth::get_raw_versions}; +use crate::{config::Cfg, db::{db_setup, user_dbversion, create_dbversion, insert_column, get_lists, get_list, get_current_versions, insert_dl_link}, modrinth::get_raw_versions}; pub async fn setup(config: Cfg) -> Result<(), Box> { @@ -10,7 +10,7 @@ pub async fn setup(config: Cfg) -> Result<(), Box> { return create(config, db_file); } - match get_dbversion(config.clone()) { + match user_dbversion(config.clone()) { Ok(ver) => { match ver.as_str() { _ => return Err(Box::new(Error::new(ErrorKind::Other, "UNKNOWN_VERSION"))) @@ -33,7 +33,7 @@ async fn to_02(config: Cfg) -> Result<(), Box> { for list in lists { println!("Updating {}", list); - insert_column(config.clone(), String::from(&list), String::from("current_download"), sqlite::Type::String)?; + insert_column(config.clone(), String::from(&list), String::from("current_download"), String::new())?; let full_list = get_list(config.clone(), String::from(&list))?; -- cgit v1.2.3