19 #ifndef QGSDATASOURCEURI_H
20 #define QGSDATASOURCEURI_H
22 #include "qgis_core.h"
72 QString connectionInfo(
bool expandAuthConfig =
true )
const;
77 QString uri(
bool expandAuthConfig =
true )
const;
82 QByteArray encodedUri()
const;
89 void setEncodedUri(
const QByteArray &uri )
SIP_SKIP;
94 void setEncodedUri(
const QString &uri );
99 QString quotedTablename()
const;
106 void setParam(
const QString &key,
const QString &value );
112 void setParam(
const QString &key,
const QStringList &value )
SIP_PYNAME( setParamList );
118 int removeParam(
const QString &key );
123 QString param(
const QString &key )
const;
128 QStringList params(
const QString &key )
const;
133 bool hasParam(
const QString &key )
const;
138 void setConnection(
const QString &aHost,
139 const QString &aPort,
140 const QString &aDatabase,
141 const QString &aUsername,
142 const QString &aPassword,
144 const QString &authConfigId = QString() );
149 void setConnection(
const QString &aService,
150 const QString &aDatabase,
151 const QString &aUsername,
152 const QString &aPassword,
154 const QString &authConfigId = QString() );
159 void setDatabase(
const QString &database );
167 void setDataSource(
const QString &aSchema,
168 const QString &aTable,
169 const QString &aGeometryColumn,
170 const QString &aSql = QString(),
171 const QString &aKeyColumn = QString() );
176 void setAuthConfigId(
const QString &authcfg );
181 void setUsername(
const QString &username );
186 void setPassword(
const QString &password );
191 static QString removePassword(
const QString &aUri );
196 QString authConfigId()
const;
199 QString username()
const;
202 QString schema()
const;
205 QString table()
const;
218 QString geometryColumn()
const;
221 void setUseEstimatedMetadata(
bool flag );
224 bool useEstimatedMetadata()
const;
227 void disableSelectAtId(
bool flag );
230 bool selectAtIdDisabled()
const;
239 void setSchema(
const QString &schema );
249 void setSql(
const QString &sql );
252 QString host()
const;
254 QString database()
const;
256 QString port()
const;
262 QString driver()
const;
268 void setDriver(
const QString &driver );
271 QString password()
const;
277 QString service()
const;
280 QString keyColumn()
const;
283 void setKeyColumn(
const QString &column );
294 QString srid()
const;
297 void setSrid(
const QString &srid );
303 static SslMode decodeSslMode(
const QString &sslMode );
309 static QString encodeSslMode(
SslMode sslMode );
315 void setTable(
const QString &table );
321 void setGeometryColumn(
const QString &geometryColumn );
327 QSet<QString> parameterKeys()
const;
344 QString httpHeader(
const QString &key ) {
return mHttpHeaders[key].toString(); }
350 void setHttpHeaders(
const QgsHttpHeaders &headers ) { mHttpHeaders = headers; }
353 SIP_PYOBJECT __repr__();
355 QString
str = QStringLiteral(
"<QgsDataSourceUri: %1>" ).arg( sipCpp->uri(
false ) );
356 sipRes = PyUnicode_FromString(
str.toUtf8().constData() );
361 void skipBlanks(
const QString &uri,
int &i );
362 QString getValue(
const QString &uri,
int &i );
363 QString escape(
const QString &uri, QChar delim )
const;
382 QString mGeometryColumn;
386 QString mAuthConfigId;
396 bool mUseEstimatedMetadata =
false;
398 bool mSelectAtIdDisabled =
false;
400 bool mSelectAtIdDisabledSet =
false;
406 QMultiMap<QString, QString> mParams;
411 #endif //QGSDATASOURCEURI_H