Skip to content

Commit

Permalink
Add comment about the callback limitations in QGIS
Browse files Browse the repository at this point in the history
  • Loading branch information
elpaso committed Dec 28, 2022
1 parent b4d73ca commit 98366e1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/core/providers/ogr/qgsogrfeatureiterator.cpp
Expand Up @@ -279,6 +279,14 @@ QgsOgrFeatureIterator::QgsOgrFeatureIterator( QgsOgrFeatureSource *source, bool

#if GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION(3,7,0)
// Install query logger
// Note: this logger won't track insert/update/delete operations,
// in order to do that the callback would need to be installed
// in the provider's dataset, but because the provider life-cycle
// is significantly longer than this iterator it wouldn't be possible
// to install the callback at a later time if the provider was created
// when the logger was disabled.
// There is currently no API to connect the change of state of the
// logger to the data provider.
if ( QgsApplication::databaseQueryLog()->enabled() )
{
GDALDatasetSetQueryLoggerFunc( mConn->ds, [ ]( const char *pszSQL, const char *pszError, int64_t lNumRecords, int64_t lExecutionTimeMilliseconds, void *pQueryLoggerArg )
Expand Down

0 comments on commit 98366e1

Please sign in to comment.