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:
parent
266f8642fb
commit
b0de37d4f9
@ -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
setup.py
2
setup.py
@ -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",
|
||||
|
Loading…
x
Reference in New Issue
Block a user