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:
voussoir 2022-03-14 15:37:46 -07:00
parent 9b2ad4d027
commit ee4914fa63
No known key found for this signature in database
GPG key ID: 5F7554F8C26DACCB

View file

@ -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]:
'''