mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-15 00:04:37 -04:00
Now all classes and members are either exposed to bindings or marked as "not available in Python bindings" in the docs. Drop test thresholds to 0. Now it should be much easier to determine what missing members have been added which are causing test failures.
135 lines
4.1 KiB
Plaintext
135 lines
4.1 KiB
Plaintext
/**
|
|
\struct QgsDataSourceURI
|
|
\brief Structure for storing the component parts of a PostgreSQL/RDBMS datasource URI.
|
|
|
|
This structure stores the database connection information, including host, database,
|
|
user name, password, schema, password, and sql where clause
|
|
*/
|
|
class QgsDataSourceURI
|
|
{
|
|
%TypeHeaderCode
|
|
#include <qgsdatasourceuri.h>
|
|
%End
|
|
|
|
public:
|
|
enum SSLmode { SSLprefer, SSLdisable, SSLallow, SSLrequire };
|
|
|
|
//! default constructor
|
|
QgsDataSourceURI();
|
|
|
|
//! constructor which parses input URI
|
|
QgsDataSourceURI( QString uri );
|
|
|
|
//! return connection part of URI
|
|
QString connectionInfo( bool expandAuthConfig = true ) const;
|
|
|
|
//! return complete uri
|
|
QString uri( bool expandAuthConfig = true ) const;
|
|
|
|
//! return complete encoded uri (generic mode)
|
|
QByteArray encodedUri() const;
|
|
|
|
//! set complete encoded uri (generic mode)
|
|
void setEncodedUri( const QString & uri );
|
|
|
|
//! quoted table name
|
|
QString quotedTablename() const;
|
|
|
|
//! Set generic param (generic mode)
|
|
// \note if key exists, another is inserted
|
|
void setParam( const QString &key, const QString &value );
|
|
//! @note available in python as setParamList
|
|
void setParam( const QString &key, const QStringList &value ) /PyName=setParamList/;
|
|
|
|
//! Remove generic param (generic mode)
|
|
// \note remove all occurrences of key, returns number of params removed
|
|
int removeParam( const QString &key );
|
|
|
|
//! Get generic param (generic mode)
|
|
QString param( const QString &key ) const;
|
|
|
|
//! Get multiple generic param (generic mode)
|
|
QStringList params( const QString &key ) const;
|
|
|
|
//! Test if param exists (generic mode)
|
|
bool hasParam( const QString &key ) const;
|
|
|
|
//! Set all connection related members at once
|
|
void setConnection( const QString& aHost,
|
|
const QString& aPort,
|
|
const QString& aDatabase,
|
|
const QString& aUsername,
|
|
const QString& aPassword,
|
|
SSLmode sslmode = SSLprefer,
|
|
const QString& authConfigId = QString() );
|
|
|
|
//! Set all connection related members at once (for the service case)
|
|
void setConnection( const QString& aService,
|
|
const QString& aDatabase,
|
|
const QString& aUsername,
|
|
const QString& aPassword,
|
|
SSLmode sslmode = SSLprefer,
|
|
const QString& authConfigId = QString() );
|
|
|
|
//! Set database
|
|
void setDatabase( const QString &database );
|
|
|
|
//! Set all data source related members at once
|
|
void setDataSource( const QString& aSchema,
|
|
const QString& aTable,
|
|
const QString& aGeometryColumn,
|
|
const QString& aSql = QString(),
|
|
const QString& aKeyColumn = QString() );
|
|
|
|
//! set authentication configuration ID
|
|
void setAuthConfigId( const QString& authcfg );
|
|
|
|
//! set username
|
|
void setUsername( const QString& username );
|
|
|
|
//! set password
|
|
void setPassword( const QString& password );
|
|
|
|
//! Removes password element from uris
|
|
static QString removePassword( const QString& aUri );
|
|
|
|
QString authConfigId() const;
|
|
QString username() const;
|
|
QString schema() const;
|
|
QString table() const;
|
|
QString sql() const;
|
|
QString geometryColumn() const;
|
|
|
|
//! set use Estimated Metadata
|
|
void setUseEstimatedMetadata( bool theFlag );
|
|
bool useEstimatedMetadata() const;
|
|
|
|
void disableSelectAtId( bool theFlag );
|
|
bool selectAtIdDisabled() const;
|
|
|
|
void clearSchema();
|
|
|
|
//! set the table schema
|
|
// @note added in 2.11
|
|
void setSchema( const QString& schema );
|
|
|
|
void setSql( const QString& sql );
|
|
|
|
QString host() const;
|
|
QString database() const;
|
|
QString port() const;
|
|
QString password() const;
|
|
SSLmode sslMode() const;
|
|
|
|
QString service() const;
|
|
|
|
QString keyColumn() const;
|
|
void setKeyColumn( const QString& column );
|
|
|
|
QGis::WkbType wkbType() const;
|
|
void setWkbType( QGis::WkbType type );
|
|
|
|
QString srid() const;
|
|
void setSrid( const QString& srid );
|
|
};
|