Unit tests for .update()

Also now set .last_pk to lastrowid for rowid tables.
This commit is contained in:
Simon Willison 2019-07-28 15:30:28 +03:00
commit 455071f3c5
2 changed files with 25 additions and 1 deletions

View file

@ -961,7 +961,7 @@ class Table:
else:
raise
self.last_rowid = result.lastrowid
self.last_pk = None
self.last_pk = self.last_rowid
# self.last_rowid will be 0 if a "INSERT OR IGNORE" happened
if (hash_id or pk) and self.last_rowid:
row = list(self.rows_where("rowid = ?", [self.last_rowid]))[0]