Skip to content
Permalink
Browse files

Optimize column information

  • Loading branch information
elpaso committed Dec 21, 2020
1 parent a277cc6 commit 3a2b8f889a2c367109f74de503c29e4ba5e361c0
Showing with 16 additions and 3 deletions.
  1. +16 −3 python/plugins/db_manager/db_plugins/postgis/connector.py
@@ -104,16 +104,29 @@ def _execute(self, sql=None):
return
self._debug("execute called with sql " + self.sql)
try:
self.result = self._toStrResultSet(self.connection.executeSql(self.sql, feedback=self.feedback))
result = self.connection.execSql(self.sql, feedback=self.feedback)
self._description = [] # reset description
self.result = self._toStrResultSet(result.rows())
for c in result.columns():
self._description.append([
c, # name
'', # type_code
-1, # display_size
-1, # internal_size
-1, # precision
None, # scale
True # null_ok
])

except QgsProviderConnectionException as e:
self._description = None
raise DbError(e, self.sql)
self._debug("execute returned " + str(len(self.result)) + " rows")
self.cursor = 0

self._description = None # reset description

@property
def description(self):
"""Returns columns description, it should be already set by _execute"""

if self._description is None:

0 comments on commit 3a2b8f8

Please sign in to comment.
You can’t perform that action at this time.