Skip to content

Configuration of connections to databases (Oracle and PostgreSQL) used by the plugin

Context

This section is based on the example of PostgreSQL databases, but the same applies to Oracle databases.

This feature is used to manage the following case: several connections have been configured in QGIS for databases with identical names (in the "Database" field of the connection configuration form).

This situation may arise in the following cases:

  • you want to connect to the same database with different users:
  • these are two databases with identical names but hosted on different servers:

Default plugin behavior

In this context, the QGIS plugin offers the user the option of adding by registered connection, specifying the name of the connection:

In this way, when adding a layer, the user can choose which connection will be used to access the corresponding table.

Setting the connections used by the QGIS plugin

To avoid having to choose the connection each time a layer is added, this choice can be permanently configured.

A dedicated graphical interface (below) can be accessed by clicking on a button in the"Add layer" section of the plugin's"Settings" tab.

The drop-down lists (right-hand column) are used to select the connection that will be used by the plugin to access the corresponding database (left-hand column).

Once configured, the user can :

  1. Reset table: to reset drop-down lists to their initial configuration (when the dialog box is opened)
  2. Save configuration: to permanently save the choices made by the user before closing the dialog box
  3. Cancel configuration: to close the dialog box without taking into account the choices made by the user

If a database connection has been modified/added/deleted during the current QGIS session (in the data source manager or in the _user/db_connections.json file), click on "Reload connections" for the modification to be taken into account by the Isogeo plugin:

Once the configuration has been saved, it is reflected in the layer addition options available to the user:

The plugin now offers the user only one add-on option, corresponding to the connection he has selected.

The search must be reset to take this configuration into account.