Class: QgsAbstractProviderConnection¶
The QgsAbstractProviderConnection
provides an interface for
data provider connections.
Connections objects can be constructed loading them from the connections stored in the settings by passing the connection name. A new connection object can also be created by passing a data source URI in the constructor.
Provider metadata keep a cache of the existing connections, to manage stored connections it is recommendend to call metadata methods instead of loading and storing the connections directly.
Concrete classes must implement methods to retrieve, save and remove connections from the settings.
Added in version 3.10.
Class Hierarchy¶
Subclasses¶
The |
Methods
Returns the connection configuration parameters |
|
Returns an icon representing the connection. |
|
Deletes the connection from the settings. |
|
Sets the connection configuration |
|
Sets the connection data source URI to uri |
|
Stores the connection in the settings. |
|
Returns the connection data source URI string representation |
- class qgis.core.QgsAbstractProviderConnection[source]¶
Bases:
object
- __init__(name: str | None)
Creates a new connection with
name
by reading its configuration from the settings. If a connection with this name cannot be found, an empty connection will be returned.- Parameters:
name (Optional[str])
- __init__(uri: str | None, configuration: Dict[str, Any])
Creates a new connection from the given
uri
andconfiguration
. The connection is not automatically stored in the settings.See also
- Parameters:
uri (Optional[str])
configuration (Dict[str, Any])
- __init__(a0: QgsAbstractProviderConnection)
- Parameters:
- configuration(self) Dict[str, Any] [source]¶
Returns the connection configuration parameters
- Return type:
Dict[str, Any]
- remove(self, name: str | None)[source]¶
Deletes the connection from the settings.
- Parameters:
name (Optional[str])
- setConfiguration(self, configuration: Dict[str, Any])[source]¶
Sets the connection
configuration
- Parameters:
configuration (Dict[str, Any])
- setUri(self, uri: str | None)[source]¶
Sets the connection data source URI to
uri
- Parameters:
uri (Optional[str])