Adding words by parts

This commit is contained in:
2026-08-15 21:32:24 +03:00
parent 8f789facd7
commit 51c8d7be74
23 changed files with 409 additions and 241 deletions
+14 -9
View File
@@ -12,7 +12,7 @@ pub struct ImportGroup {
pub fields: Vec<String>,
pub length: u64,
pub mapping: HashMap<String, String>,
pub imported: bool
pub imported: bool,
}
#[derive(Clone)]
@@ -68,13 +68,18 @@ pub fn get_words_of_group(connection: &Connection, group_id: u64) -> Vec<ImportN
.prepare("select tags, flds from notes where mid == ?1;")
.unwrap();
count_stmt.query_map((group_id as i64, ), |row| {
Ok(ImportNote {
tags: row.get(0)?,
fields: row.get::<usize, String>(1)?
.split('')
.map(|x| x.to_string())
.collect()
count_stmt
.query_map((group_id as i64,), |row| {
Ok(ImportNote {
tags: row.get(0)?,
fields: row
.get::<usize, String>(1)?
.split('')
.map(|x| x.to_string())
.collect(),
})
})
}).unwrap().map(|x| x.unwrap()).collect::<Vec<ImportNote>>()
.unwrap()
.map(|x| x.unwrap())
.collect::<Vec<ImportNote>>()
}