lutraconsulting / qgis-geocat-plugin

Plugin for loading PostGIS layers based on a metadata search
GNU General Public License v2.0
5 stars 1 forks source link

Multiple-database support #32

Closed mostlyAtNight closed 5 years ago

mostlyAtNight commented 5 years ago

Feature request for supporting multiple databases.

Background: Imagine that you have a bunch of users who use the plugin to browse layers via metadata. The metadata is in database A. Some of the layers referred to in the metadata are in database A but some are actually in a different database, database B.

The plugin configuration should feature an additional, option advanced configuration parameter which is the column in the metadata table which describes the PostGIS database connection in QGIS to use to access the table.

Workflow:

Users have two PostGIS connections configured in QGIS:

Layer Metadata Search is configured to use DB A for searching.

For any given layer that the user tries to load, the plugin will look at the column configured (if configured) which specifies which QGIS DB connection to use to load the layer. If the column contains NULL, the plugin will use its normally configured connection (in this case 'Database A'). If the row has a value in the column mentioned above (e.g. 'Database B') then the plugin will search the QGIS configuration and locate the first matching entry with the same name ('Database B'). That connection will be used to load the layer. If the connection fails (with DB B in this case) an error will be displayed to the user (it will not fall-back to the connection the plugin normally uses to search).

saberraz commented 5 years ago

I suppose this is resolved now?

ldebek commented 5 years ago

Yes it is.