19#ifndef QGSDATASOURCEURI_H
20#define QGSDATASOURCEURI_H
77 QString
uri(
bool expandAuthConfig =
true )
const;
106 void setParam(
const QString &key,
const QString &value );
112 void setParam(
const QString &key,
const QStringList &value )
SIP_PYNAME( setParamList );
123 QString
param(
const QString &key )
const;
128 QStringList
params(
const QString &key )
const;
133 bool hasParam(
const QString &key )
const;
139 const QString &aPort,
140 const QString &aDatabase,
141 const QString &aUsername,
142 const QString &aPassword,
150 const QString &aDatabase,
151 const QString &aUsername,
152 const QString &aPassword,
168 const QString &aTable,
169 const QString &aGeometryColumn,
170 const QString &aSql = QString(),
171 const QString &aKeyColumn = QString() );
196 static QString
removePassword(
const QString &aUri,
bool hide =
false );
210 QString
table()
const;
268 QString
host()
const;
286 QString
port()
const;
346 QString
srid()
const;
396 QString
httpHeader(
const QString &key ) {
return mHttpHeaders[key].toString(); }
405 SIP_PYOBJECT __repr__();
407 QString str = QStringLiteral(
"<QgsDataSourceUri: %1>" ).arg( sipCpp->uri(
false ) );
408 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
416 void skipBlanks(
const QString &uri,
int &i );
417 QString getValue(
const QString &uri,
int &i );
418 QString escape(
const QString &uri, QChar delim )
const;
437 QString mGeometryColumn;
441 QString mAuthConfigId;
447 SslMode mSSLmode = SslPrefer;
451 bool mUseEstimatedMetadata =
false;
453 bool mSelectAtIdDisabled =
false;
455 bool mSelectAtIdDisabledSet =
false;
461 QMultiMap<QString, QString> mParams;
WkbType
The WKB type describes the number of dimensions a geometry has.
Stores the component parts of a data source URI (e.g.
QString srid() const
Returns the spatial reference ID associated with the URI.
SslMode
Available SSL connection modes.
void setConnection(const QString &aHost, const QString &aPort, const QString &aDatabase, const QString &aUsername, const QString &aPassword, SslMode sslmode=SslPrefer, const QString &authConfigId=QString())
Sets all connection related members at once.
QByteArray encodedUri() const
Returns the complete encoded URI as a byte array.
QStringList params(const QString &key) const
Returns multiple generic parameter values corresponding to the specified key.
void setSchema(const QString &schema)
Sets the scheme for the URI.
bool hasParam(const QString &key) const
Returns true if a parameter with the specified key exists.
int removeParam(const QString &key)
Removes a generic parameter by key.
static SslMode decodeSslMode(const QString &sslMode)
Decodes SSL mode string into enum value.
void setSql(const QString &sql)
Sets the sql filter for the URI.
void setEncodedUri(const QByteArray &uri)
Sets the complete encoded uri.
QgsDataSourceUri(const QByteArray &uri)
Constructor for QgsDataSourceUri which parses an input encoded uri).
QString table() const
Returns the table name stored in the URI.
void setTable(const QString &table)
Sets table to table.
void setAuthConfigId(const QString &authcfg)
Sets the authentication configuration ID for the URI.
QString quotedTablename() const
Returns the URI's table name, escaped and quoted.
void setGeometryColumn(const QString &geometryColumn)
Sets geometry column name to geometryColumn.
QString schema() const
Returns the schema stored in the URI.
void setUseEstimatedMetadata(bool flag)
Sets whether estimated metadata should be used for the connection.
QString connectionInfo(bool expandAuthConfig=true) const
Returns the connection part of the URI.
QgsHttpHeaders httpHeaders() const
Returns http headers.
QString uri(bool expandAuthConfig=true) const
Returns the complete URI as a string.
void setUsername(const QString &username)
Sets the username for the URI.
QString param(const QString &key) const
Returns a generic parameter value corresponding to the specified key.
void disableSelectAtId(bool flag)
Set to true to disable selection by feature ID.
bool selectAtIdDisabled() const
Returns whether the selection by feature ID is disabled.
void setHost(const QString &host)
Sets the host name stored in the URI.
void setDataSource(const QString &aSchema, const QString &aTable, const QString &aGeometryColumn, const QString &aSql=QString(), const QString &aKeyColumn=QString())
Sets all data source related members at once.
QString username() const
Returns the username stored in the URI.
void setService(const QString &service)
Sets the service name associated with the URI.
static QString encodeSslMode(SslMode sslMode)
Encodes SSL mode enum value into a string.
Qgis::WkbType wkbType() const
Returns the WKB type associated with the URI.
void setSslMode(SslMode mode)
Sets the SSL mode associated with the URI.
void setWkbType(Qgis::WkbType type)
Sets the WKB type associated with the URI.
QString driver() const
Returns the driver name stored in the URI.
QString host() const
Returns the host name stored in the URI.
void setPort(const QString &port)
Sets the port stored in the URI.
void setParam(const QString &key, const QString &value)
Sets a generic parameter value on the URI.
QString service() const
Returns the service name associated with the URI.
void setKeyColumn(const QString &column)
Sets the name of the (primary) key column.
bool useEstimatedMetadata() const
Returns true if estimated metadata should be used for the connection.
QgsHttpHeaders & httpHeaders()
Returns http headers.
SslMode sslMode() const
Returns the SSL mode associated with the URI.
QString password() const
Returns the password stored in the URI.
QString keyColumn() const
Returns the name of the (primary) key column for the referenced table.
QString authConfigId() const
Returns any associated authentication configuration ID stored in the URI.
QString port() const
Returns the port stored in the URI.
QSet< QString > parameterKeys() const
Returns parameter keys used in the uri: specialized ones ("table", "schema", etc.) or generic paramet...
QString database() const
Returns the database name stored in the URI.
void clearSchema()
Clears the schema stored in the URI.
void setDriver(const QString &driver)
Sets the driver name stored in the URI.
static QString removePassword(const QString &aUri, bool hide=false)
Removes the password element from a URI.
void setHttpHeaders(const QgsHttpHeaders &headers)
Sets headers to headers.
void setDatabase(const QString &database)
Sets the URI database name.
QString geometryColumn() const
Returns the name of the geometry column stored in the URI, if set.
void setSrid(const QString &srid)
Sets the spatial reference ID associated with the URI.
QString httpHeader(const QString &key)
Returns the http header value according to key.
QString sql() const
Returns the SQL filter stored in the URI, if set.
void setPassword(const QString &password)
Sets the password for the URI.
bool operator==(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
bool operator!=(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)