Skip to content

Commit

Permalink
Move PGException to more convenient header
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Apr 6, 2023
1 parent 2e7b0dd commit a818682
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
16 changes: 16 additions & 0 deletions src/providers/postgres/qgspostgresconn.h
Expand Up @@ -67,6 +67,7 @@ struct QgsPostgresSchemaProperty
QString owner;
};


//! Layer Property structure
// TODO: Fill to Postgres/PostGIS specifications
struct QgsPostgresLayerProperty
Expand Down Expand Up @@ -188,6 +189,21 @@ class QgsPostgresResult

};

struct PGException
{
explicit PGException( QgsPostgresResult &r )
: mWhat( r.PQresultErrorMessage() )
{}

QString errorMessage() const
{
return mWhat;
}

private:
QString mWhat;
};

//! Wraps acquireConnection() and releaseConnection() from a QgsPostgresConnPool.
// This can be used for creating std::shared_ptr<QgsPoolPostgresConn>.
class QgsPoolPostgresConn
Expand Down
15 changes: 0 additions & 15 deletions src/providers/postgres/qgspostgresprovider.h
Expand Up @@ -439,21 +439,6 @@ class QgsPostgresProvider final: public QgsVectorDataProvider

struct PGFieldNotFound {}; //! Exception to throw

struct PGException
{
explicit PGException( QgsPostgresResult &r )
: mWhat( r.PQresultErrorMessage() )
{}

QString errorMessage() const
{
return mWhat;
}

private:
QString mWhat;
};

// A function that determines if the given columns contain unique entries
bool uniqueData( const QString &quotedColNames );

Expand Down

0 comments on commit a818682

Please sign in to comment.