mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-10 07:26:01 -06:00
Resolved issues regarding the rows, and column description not return by
the given query in the execute_dict and execute_2darray function in the psycopg2 driver.
This commit is contained in:
parent
109b367fc3
commit
49373df02d
@ -356,11 +356,14 @@ Attempt to reconnect it failed with the below error:
|
||||
|
||||
import copy
|
||||
# Get Resultset Column Name, Type and size
|
||||
columns = [copy.deepcopy(desc.__dict__) for desc in cur.description]
|
||||
columns = cur.description and [
|
||||
copy.deepcopy(desc.__dict__) for desc in cur.description
|
||||
] or []
|
||||
|
||||
rows = []
|
||||
for row in cur:
|
||||
rows.append(row)
|
||||
if cur.rowcount > 0:
|
||||
for row in cur:
|
||||
rows.append(row)
|
||||
|
||||
return True, {'columns': columns, 'rows': rows}
|
||||
|
||||
@ -395,11 +398,14 @@ Attempt to reconnect it failed with the below error:
|
||||
|
||||
import copy
|
||||
# Get Resultset Column Name, Type and size
|
||||
columns = [copy.deepcopy(desc.__dict__) for desc in cur.description]
|
||||
columns = cur.description and [
|
||||
copy.deepcopy(desc.__dict__) for desc in cur.description
|
||||
] or []
|
||||
|
||||
rows = []
|
||||
for row in cur:
|
||||
rows.append(dict(row))
|
||||
if cur.rowcount > 0:
|
||||
for row in cur:
|
||||
rows.append(dict(row))
|
||||
|
||||
return True, {'columns': columns, 'rows': rows}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user