Skip to content

Commit 4e30eb4

Browse files
authored
Fix using virtual layers in DB manager
getTableFields and getTableRowCount receive the table name and not the table. I did not change the argument name (although it would be good) to keep it in line with all the other methods see: https://github.com/qgis/QGIS/blob/master/python/plugins/db_manager/db_plugins/plugin.py#L742 https://github.com/qgis/QGIS/blob/master/python/plugins/db_manager/db_plugins/plugin.py#L879
1 parent 4b7da69 commit 4e30eb4

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

python/plugins/db_manager/db_plugins/vlayers/connector.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -250,16 +250,14 @@ def getRasterTables(self, schema=None):
250250
return []
251251

252252
def getTableRowCount(self, table):
253-
t = table[1]
254-
l = VLayerRegistry.instance().getLayer(t)
253+
l = VLayerRegistry.instance().getLayer(table)
255254
if not l or not l.isValid():
256255
return None
257256
return l.featureCount()
258257

259258
def getTableFields(self, table):
260259
""" return list of columns in table """
261-
t = table[1]
262-
l = VLayerRegistry.instance().getLayer(t)
260+
l = VLayerRegistry.instance().getLayer(table)
263261
if not l or not l.isValid():
264262
return []
265263
# id, name, type, nonnull, default, pk

0 commit comments

Comments
 (0)