mirror of
https://github.com/datahub-project/datahub.git
synced 2025-08-19 14:44:37 +00:00
Merge pull request #137 from jerrybai2009/master
add the copy_dict_cursor function since it is used by elastic search refresh
This commit is contained in:
commit
391d0d27c6
@ -17,3 +17,10 @@ def dict_cursor(cursor):
|
||||
description = [x[0] for x in cursor.description]
|
||||
for row in cursor:
|
||||
yield dict(zip(description, row))
|
||||
|
||||
def copy_dict_cursor(cursor):
|
||||
result = []
|
||||
description = [x[0] for x in cursor.description]
|
||||
for row in cursor:
|
||||
result.append(dict(zip(description, row)))
|
||||
return result
|
||||
|
Loading…
x
Reference in New Issue
Block a user