What if I would like to have the full SpatiaLite database path from a vector layer loaded in the TOC with PyQGIS?
With a very simple example, by storing active vector layer in a variable:
vl = iface.activeLayer()
one can retrieve the providerType
and the dataSourceUri
:
vl.providerType()
u'spatialite'
vl.dataProvider().dataSourceUri()
vl.dataProvider().dataSourceUri()
u'dbname=\'/home/matteo/myDataBase.sqlite\' table="river_layer" (geometry) sql='
Is there a simple method to get as a string, just the path of the database (so. /home/matteo/myDataBase.sqlite)?