Wire datetime_columns through query params and reads; add db_size and vacuum guard
This commit is contained in:
@@ -67,6 +67,7 @@ class CachingEngine:
|
||||
dialect: str | None = None,
|
||||
pragmas: dict[str, str | int] | None = None,
|
||||
datetime_columns: dict[str, list[str]] | None = None,
|
||||
return_datetime: bool = True,
|
||||
blocking_startup_refresh: bool = False,
|
||||
) -> None:
|
||||
self._source_engine = source_engine
|
||||
@@ -83,6 +84,7 @@ class CachingEngine:
|
||||
fetch_batch=fetch_batch if fetch_batch is not None else FETCH_BATCH_SIZE,
|
||||
pragmas=pragmas,
|
||||
datetime_columns=datetime_columns,
|
||||
return_datetime=return_datetime,
|
||||
)
|
||||
self._registry = ColumnRegistry(self._cache.connection)
|
||||
self._stats = StatsCollector()
|
||||
@@ -152,7 +154,11 @@ class CachingEngine:
|
||||
last_runs = self._cache.get_last_runs()
|
||||
with self._cache._lock:
|
||||
base = self._stats.snapshot(self._cache.connection, states)
|
||||
base = replace(base, errors=self._cache.error_total)
|
||||
base = replace(
|
||||
base,
|
||||
errors=self._cache.error_total,
|
||||
db_size_bytes=self._cache.db_size_bytes(),
|
||||
)
|
||||
return replace(
|
||||
base,
|
||||
tables={n: self._enrich(n, t, errors, last_runs) for n, t in base.tables.items()},
|
||||
|
||||
Reference in New Issue
Block a user