use total_changes() sqlite func

This commit is contained in:
Damien Elmes 2020-03-03 07:42:54 +10:00
parent 5f442ae95e
commit 87415c0d7f
2 changed files with 3 additions and 5 deletions

View File

@ -62,9 +62,6 @@ class DBProxy:
def close(self) -> None:
self._db.close()
def totalChanges(self) -> Any:
return self._db.total_changes
def setAutocommit(self, autocommit: bool) -> None:
if autocommit:
self._db.isolation_level = None

View File

@ -287,7 +287,7 @@ content in the text file to the correct fields."""
return [intTime(), self.col.usn(), n.fieldsStr, id, n.fieldsStr]
def addUpdates(self, rows: List[List[Union[int, str]]]) -> None:
old = self.col.db.totalChanges()
changes = self.col.db.scalar("select total_changes()")
if self._tagsMapped:
self.col.db.executemany(
"""
@ -309,7 +309,8 @@ update notes set mod = ?, usn = ?, flds = ?
where id = ? and flds != ?""",
rows,
)
self.updateCount = self.col.db.totalChanges() - old
changes2 = self.col.db.scalar("select total_changes()")
self.updateCount = changes2 - changes
def processFields(
self, note: ForeignNote, fields: Optional[List[str]] = None