1
0
mirror of https://github.com/simon987/hexlib.git synced 2025-04-15 16:26:41 +00:00

Fix pg cursor

This commit is contained in:
simon987 2020-08-20 21:10:31 -04:00
parent 266f8642fb
commit b0de37d4f9
2 changed files with 3 additions and 3 deletions

@ -134,7 +134,7 @@ def _deserialize(value, col_type):
def pg_fetch_cursor_all(cur, name, batch_size=1000):
while True:
cur.execute("FETCH FORWARD %s FROM %s", (batch_size, name))
cur.execute("FETCH FORWARD %d FROM %s" % (batch_size, name))
cnt = 0
for row in cur:
@ -142,7 +142,7 @@ def pg_fetch_cursor_all(cur, name, batch_size=1000):
yield row
if cnt != batch_size:
cur.execute("FETCH ALL FROM %s", (batch_size, name))
cur.execute("FETCH ALL FROM %s" % (name,))
for row in cur:
yield row
break

@ -2,7 +2,7 @@ from setuptools import setup
setup(
name="hexlib",
version="1.16",
version="1.17",
description="Misc utility methods",
author="simon987",
author_email="me@simon987.net",