From ee4914fa63dca22a19f21d78d7786a60ad461bb1 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Mon, 14 Mar 2022 15:37:46 -0700 Subject: [PATCH] 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. --- voussoirkit/worms.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/voussoirkit/worms.py b/voussoirkit/worms.py index 0494ebc..3285972 100644 --- a/voussoirkit/worms.py +++ b/voussoirkit/worms.py @@ -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]: '''