Batch large-table loads to bound memory and add per-table state to stats

This commit is contained in:
Jan Doubravský
2026-06-05 14:44:07 +02:00
parent 85bb84a1a6
commit 286a5f207d
11 changed files with 436 additions and 29 deletions
+10 -2
View File
@@ -10,11 +10,19 @@ from sqlmem.cache import CacheManager
class _FakeCursor:
def __init__(self, rows):
self._rows = rows
self._rows = list(rows)
self._pos = 0
self.description = None
def fetchall(self):
return self._rows
out = self._rows[self._pos :]
self._pos = len(self._rows)
return out
def fetchmany(self, size):
out = self._rows[self._pos : self._pos + size]
self._pos += len(out)
return out
class FakeSource: