mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -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
|
import copy
|
||||||
# Get Resultset Column Name, Type and size
|
# 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 = []
|
rows = []
|
||||||
for row in cur:
|
if cur.rowcount > 0:
|
||||||
rows.append(row)
|
for row in cur:
|
||||||
|
rows.append(row)
|
||||||
|
|
||||||
return True, {'columns': columns, 'rows': rows}
|
return True, {'columns': columns, 'rows': rows}
|
||||||
|
|
||||||
@ -395,11 +398,14 @@ Attempt to reconnect it failed with the below error:
|
|||||||
|
|
||||||
import copy
|
import copy
|
||||||
# Get Resultset Column Name, Type and size
|
# 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 = []
|
rows = []
|
||||||
for row in cur:
|
if cur.rowcount > 0:
|
||||||
rows.append(dict(row))
|
for row in cur:
|
||||||
|
rows.append(dict(row))
|
||||||
|
|
||||||
return True, {'columns': columns, 'rows': rows}
|
return True, {'columns': columns, 'rows': rows}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user