Add self.last_commit_id to help application know state of the world.
This allows caching layers to make better decisions about when to reload data.
This commit is contained in:
parent
9b2ad4d027
commit
ee4914fa63
1 changed files with 2 additions and 0 deletions
|
@ -97,6 +97,7 @@ class Database(metaclass=abc.ABCMeta):
|
|||
self.on_commit_queue = []
|
||||
self.on_rollback_queue = []
|
||||
self.savepoints = []
|
||||
self.last_commit_id = None
|
||||
|
||||
@abc.abstractmethod
|
||||
def _init_column_index(self):
|
||||
|
@ -151,6 +152,7 @@ class Database(metaclass=abc.ABCMeta):
|
|||
|
||||
self.savepoints.clear()
|
||||
self.sql.commit()
|
||||
self.last_commit_id = RNG.getrandbits(32)
|
||||
|
||||
def get_tables(self) -> set[str]:
|
||||
'''
|
||||
|
|
Loading…
Reference in a new issue