Fixes for sqlite data layer
This commit is contained in:
1 parent
7f9aa11d6e
commit
242b56fc21
9 files changed
+73
-67
No files matched your search
@@ -20,7 +20,7 @@ impl TableAccessQuerySet<WordData> for WordQuerySet {
|
||||
}
|
||||
|
||||
fn add() -> &'static str {
|
||||
"INSERT INTO words (key, value, tags, more, group_id) VALUES (?1, ?2, ?3, ?4, ?5) RETURNING id"
|
||||
"INSERT INTO words (key, value, tags, more, group_id) VALUES (?1, ?2, ?3, ?4, ?5)"
|
||||
}
|
||||
|
||||
fn name() -> &'static str {
|
||||
@@ -63,7 +63,7 @@ impl TableAccessQuerySet<WordData> for WordQuerySet {
|
||||
pub fn add_word(word: &mut WordData, connection: &Connection) -> MaybeError {
|
||||
let index : u32 = connection
|
||||
.query_row(
|
||||
"INSERT INTO words (key, value, tags, more, group_id) VALUES (?1, ?2, ?3, ?4, ?5) RETURNING id",
|
||||
"INSERT INTO words (key, value, tags, more, group_id) VALUES (?1, ?2, ?3, ?4, ?5)",
|
||||
(
|
||||
&word.key,
|
||||
&word.value,
|
||||
@@ -193,7 +193,7 @@ pub fn load_word_groups(connection: &Connection) -> Result<Vec<WordGroup>, Notif
|
||||
pub fn add_group(group: &mut WordGroup, connection: &Connection) -> MaybeError {
|
||||
let index: u32 = connection
|
||||
.query_row(
|
||||
"INSERT INTO word_groups (name) VALUES (?1) RETURNING id",
|
||||
"INSERT INTO word_groups (name) VALUES (?1)",
|
||||
(&group.name,),
|
||||
|row| row.get(0),
|
||||
)
|
||||
|
||||
Reference in new issue
Block a user