Found why Edit*() methods didn't work, for UPDATE query Exec() method must be used instead of QueryRow().
This commit is contained in:
parent
cb623e8087
commit
5a72fbecb4
@ -212,9 +212,9 @@ func (d *SQLiteDatabase) EditEntry(entry *guestbook.Entry) error {
|
|||||||
}
|
}
|
||||||
defer tx.Rollback()
|
defer tx.Rollback()
|
||||||
|
|
||||||
row := tx.Stmt(stmtUpdateEntry).QueryRow(entry.Name, entry.Message, entry.Website, entry.HideWebsite, entry.ID)
|
_, err = tx.Stmt(stmtUpdateEntry).Exec(entry.Name, entry.Message, entry.Website, entry.HideWebsite, entry.ID)
|
||||||
if row.Err() != nil {
|
if err != nil {
|
||||||
return row.Err()
|
return err
|
||||||
}
|
}
|
||||||
tx.Commit()
|
tx.Commit()
|
||||||
|
|
||||||
@ -261,9 +261,9 @@ func (d *SQLiteDatabase) EditReply(reply *guestbook.Reply) error {
|
|||||||
}
|
}
|
||||||
defer tx.Rollback()
|
defer tx.Rollback()
|
||||||
|
|
||||||
row := tx.Stmt(stmtUpdateReply).QueryRow(reply.Message, reply.ID)
|
_, err = tx.Stmt(stmtUpdateReply).Exec(reply.Message, reply.ID)
|
||||||
if row.Err() != nil {
|
if err != nil {
|
||||||
return row.Err()
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
tx.Commit()
|
tx.Commit()
|
||||||
|
Loading…
Reference in New Issue
Block a user