How get PostGIS DB name from QGIS layer

المشرف العام

Administrator
طاقم الإدارة
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:

  1. 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?
  2. If not, do I need to parse the URI of the layer? How do I get that information?

أكثر...
 
أعلى