Skip to content

Commit

Permalink
Gpkg connections have relationship edit capabilities on GDAL >= 3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jan 16, 2023
1 parent 5e56917 commit 799c53b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
12 changes: 6 additions & 6 deletions src/core/providers/ogr/qgsgeopackageproviderconnection.cpp
Expand Up @@ -17,17 +17,11 @@
#include <sqlite3.h>

#include "qgsgeopackageproviderconnection.h"
#include "qgsogrdbconnection.h"
#include "qgssettings.h"
#include "qgsogrprovider.h"
#include "qgsmessagelog.h"
#include "qgsproviderregistry.h"
#include "qgsprovidermetadata.h"
#include "qgsapplication.h"
#include "qgsvectorlayer.h"
#include "qgsfeedback.h"
#include "qgsogrutils.h"
#include "qgsfielddomain.h"
#include "qgscoordinatetransform.h"

#include <QTextCodec>
Expand Down Expand Up @@ -354,6 +348,12 @@ void QgsGeoPackageProviderConnection::setDefaultCapabilities()
{
Qgis::SqlLayerDefinitionCapability::SubsetStringFilter,
};

#if GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION(3,7,0)
mCapabilities |= Capability::AddRelationship;
mCapabilities |= Capability::UpdateRelationship;
mCapabilities |= Capability::DeleteRelationship;
#endif
}

QString QgsGeoPackageProviderConnection::primaryKeyColumnName( const QString &table ) const
Expand Down
1 change: 0 additions & 1 deletion src/core/providers/ogr/qgsgeopackageproviderconnection.h
Expand Up @@ -19,7 +19,6 @@

#include "qgsabstractdatabaseproviderconnection.h"
#include "qgsogrproviderconnection.h"
#include "qgsogrutils.h"

///@cond PRIVATE
#define SIP_NO_FILE
Expand Down
2 changes: 0 additions & 2 deletions src/core/providers/qgsabstractproviderconnection.h
Expand Up @@ -21,8 +21,6 @@

#include "qgis_core.h"
#include "qgis_sip.h"
#include "qgsdatasourceuri.h"
#include "qgsexception.h"

/**
* \brief The QgsAbstractProviderConnection provides an interface for data provider connections.
Expand Down
1 change: 1 addition & 0 deletions src/core/vectortile/qgsvectortileconnection.h
Expand Up @@ -24,6 +24,7 @@
#include <QStringList>

#include "qgsabstractproviderconnection.h"
#include "qgshttpheaders.h"

class CORE_EXPORT QgsVectorTileProviderConnection : public QgsAbstractProviderConnection
{
Expand Down

0 comments on commit 799c53b

Please sign in to comment.