Skip to content
Permalink
Browse files

[Spatialite] Handle a pragma='pragma_name=value' URI parameter.

This will be used by the WFS provider to improve commit time to its
temporary Spatialite DB.
  • Loading branch information
rouault committed Apr 5, 2016
1 parent c3760ec commit c178aef45168cb4a05067128a012fd348f15d11e
Showing with 13 additions and 0 deletions.
  1. +13 −0 src/providers/spatialite/qgsspatialiteprovider.cpp
@@ -453,6 +453,19 @@ QgsSpatiaLiteProvider::QgsSpatiaLiteProvider( QString const &uri )
}
sqliteHandle = handle->handle();

if ( sqliteHandle )
{
QStringList pragmaList = anUri.params( "pragma" );
Q_FOREACH ( QString pragma, pragmaList )
{
char* errMsg = nullptr;
int ret = sqlite3_exec( sqliteHandle, ( "PRAGMA " + pragma ).toUtf8(), nullptr, nullptr, &errMsg );
if ( ret != SQLITE_OK )
QgsDebugMsg( QString( "PRAGMA " ) + pragma + QString( " failed : %1" ).arg( errMsg ? errMsg : "" ) );
sqlite3_free( errMsg );
}
}

bool alreadyDone = false;
bool ret = false;

0 comments on commit c178aef

Please sign in to comment.
You can’t perform that action at this time.