I'm writing a custom Processing script that needs to know which database connection a vector layer resides in. I can't find anywhere in the API a function to return this information from a layer. So I guess I have two questions:
- Is there a Python function (either from qgis.core or from Processing tools) that easily returns things like the DB name, schema, etc. of a given layer?
- If not, do I need to parse the URI of the layer? How do I get that information?