You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
log.debug(f"There are {count} records in {table}")
316
317
returncount
317
318
318
-
asyncdefgetPage(self,
319
-
chunk: int,
320
-
table: str,
321
-
):
319
+
asyncdefgetPage(
320
+
self,
321
+
chunk: int,
322
+
table: str,
323
+
):
322
324
"""Return a page of data.
323
325
324
326
Args:
@@ -330,18 +332,18 @@ async def getPage(self,
330
332
"""
331
333
result=list()
332
334
asyncwithself.pg.transaction():
333
-
cur=awaitself.pg.cursor(f'SELECT * FROM {table}')
335
+
cur=awaitself.pg.cursor(f"SELECT * FROM {table}")
334
336
result=awaitcur.fetch(chunk)
335
337
awaitcur.forward(chunk)
336
338
# FIXME: the hard way
337
339
# sql = f"DECLARE c CURSOR WITH HOLD FOR SELECT row_to_json({table}) AS row FROM {table} WHERE id BETWEEN {start} AND {end} ORDER BY id; COMMIT"
338
340
# sql = f"START TRANSACTION;DECLARE c CURSOR WITH HOLD FOR SELECT row_to_json({table}) AS row FROM {table} WHERE id BETWEEN {start} AND {end} ORDER BY id; COMMIT"
0 commit comments