Skip to content
Permalink
Browse files

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
  • Loading branch information
mbernasocchi committed Sep 10, 2018
1 parent 4b7da69 commit 4e30eb40b0219763547d200b5979b24f3c417247
Showing with 2 additions and 4 deletions.
  1. +2 −4 python/plugins/db_manager/db_plugins/vlayers/connector.py
@@ -250,16 +250,14 @@ def getRasterTables(self, schema=None):
return []

def getTableRowCount(self, table):
t = table[1]
l = VLayerRegistry.instance().getLayer(t)
l = VLayerRegistry.instance().getLayer(table)
if not l or not l.isValid():
return None
return l.featureCount()

def getTableFields(self, table):
""" return list of columns in table """
t = table[1]
l = VLayerRegistry.instance().getLayer(t)
l = VLayerRegistry.instance().getLayer(table)
if not l or not l.isValid():
return []
# id, name, type, nonnull, default, pk

0 comments on commit 4e30eb4

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