Class: QgsDataSourceUri¶
-
class
qgis.core.
QgsDataSourceUri
¶ Bases:
sip.wrapper
default constructor
QgsDataSourceUri(uri: str) constructor which parses input URI
QgsDataSourceUri(QgsDataSourceUri)
Enums
Methods
Any associated authentication configuration ID
Clears the schema
Returns connection part of URI
Returns the database
Decodes SSL mode string into enum value.
Sets to true to disable selection by id
Encodes SSL mode enum value into a string.
Returns complete encoded uri (generic mode)
Returns the name of the geometry column
Test if param exists (generic mode)
Returns the host
Returns the name of the (primary) key column
Gets generic param (generic mode)
Gets multiple generic param (generic mode)
Returns the password
Returns the port
quoted table name
Remove generic param (generic mode)
Removes password element from uris
Returns the schema
Returns whether the selection by id is disabled
Returns the service name
Sets authentication configuration ID
Sets all connection related members at once
Sets all data source related members at once
Sets database
Sets complete encoded uri (generic mode)
Sets the name of the (primary) key column
Set generic param (generic mode)
Sets password
Sets the SQL query
Sets the srid
Sets use Estimated Metadata
Sets username
Sets the wkb type
Returns the SQL query
Returns the srid
Returns the SSL mode
Returns the table
Returns complete uri
Returns true if estimated metadata are used
Returns the username
The wkb type.
Signals
Attributes
-
SslAllow
= 2¶
-
SslDisable
= 1¶
-
class
SslMode
¶ Bases:
int
-
baseClass
¶ alias of
QgsDataSourceUri
-
-
SslPrefer
= 0¶
-
SslRequire
= 3¶
-
SslVerifyCa
= 4¶
-
SslVerifyFull
= 5¶
-
authConfigId
(self) → str¶ Any associated authentication configuration ID
-
clearSchema
(self)¶ Clears the schema
-
connectionInfo
(self, expandAuthConfig: bool = True) → str¶ Returns connection part of URI
-
database
(self) → str¶ Returns the database
-
decodeSslMode
(sslMode: str) → QgsDataSourceUri.SslMode¶ Decodes SSL mode string into enum value. If the string is not recognized, SslPrefer is returned.
New in version 3.2.
-
disableSelectAtId
(self, flag: bool)¶ Sets to true to disable selection by id
-
driver
(self) → str¶
-
encodeSslMode
(sslMode: QgsDataSourceUri.SslMode) → str¶ Encodes SSL mode enum value into a string.
New in version 3.2.
-
encodedUri
(self) → QByteArray¶ Returns complete encoded uri (generic mode)
-
geometryColumn
(self) → str¶ Returns the name of the geometry column
-
hasParam
(self, key: str) → bool¶ Test if param exists (generic mode)
-
host
(self) → str¶ Returns the host
-
keyColumn
(self) → str¶ Returns the name of the (primary) key column
-
param
(self, key: str) → str¶ Gets generic param (generic mode)
-
params
(self, key: str) → List[str]¶ Gets multiple generic param (generic mode)
-
password
(self) → str¶ Returns the password
-
port
(self) → str¶ Returns the port
-
quotedTablename
(self) → str¶ quoted table name
-
removeParam
(self, key: str) → int¶ Remove generic param (generic mode)
Note
remove all occurrences of key, returns number of params removed
-
removePassword
(aUri: str) → str¶ Removes password element from uris
-
schema
(self) → str¶ Returns the schema
-
selectAtIdDisabled
(self) → bool¶ Returns whether the selection by id is disabled
-
service
(self) → str¶ Returns the service name
-
setAuthConfigId
(self, authcfg: str)¶ Sets authentication configuration ID
-
setConnection
(self, aHost: str, aPort: str, aDatabase: str, aUsername: str, aPassword: str, sslmode: QgsDataSourceUri.SslMode = QgsDataSourceUri.SslPrefer, authConfigId: str = '')¶ Sets all connection related members at once
setConnection(self, aService: str, aDatabase: str, aUsername: str, aPassword: str, sslmode: QgsDataSourceUri.SslMode = QgsDataSourceUri.SslPrefer, authConfigId: str = ‘’) Sets all connection related members at once (for the service case)
-
setDataSource
(self, aSchema: str, aTable: str, aGeometryColumn: str, aSql: str = '', aKeyColumn: str = '')¶ Sets all data source related members at once
-
setDatabase
(self, database: str)¶ Sets database
-
setDriver
(self, driver: str)¶
-
setEncodedUri
(self, uri: str)¶ Sets complete encoded uri (generic mode)
-
setKeyColumn
(self, column: str)¶ Sets the name of the (primary) key column
-
setParam
(self, key: str, value: str)¶ Set generic param (generic mode)
Note
if key exists, another is inserted
-
setParamList
(self, key: str, value: Iterable[str])¶ Note
available in Python as setParamList
-
setPassword
(self, password: str)¶ Sets password
-
setSchema
(self, schema: str)¶
-
setSql
(self, sql: str)¶ Sets the SQL query
-
setSrid
(self, srid: str)¶ Sets the srid
-
setUseEstimatedMetadata
(self, flag: bool)¶ Sets use Estimated Metadata
-
setUsername
(self, username: str)¶ Sets username
-
setWkbType
(self, type: QgsWkbTypes.Type)¶ Sets the wkb type
-
sql
(self) → str¶ Returns the SQL query
-
srid
(self) → str¶ Returns the srid
-
sslMode
(self) → QgsDataSourceUri.SslMode¶ Returns the SSL mode
-
staticMetaObject
= <PyQt5.QtCore.QMetaObject object>¶
-
table
(self) → str¶ Returns the table
-
uri
(self, expandAuthConfig: bool = True) → str¶ Returns complete uri
-
useEstimatedMetadata
(self) → bool¶ Returns true if estimated metadata are used
-
username
(self) → str¶ Returns the username
-
wkbType
(self) → QgsWkbTypes.Type¶ The wkb type.
-