Skip to content

Commit

Permalink
[Spatialite] Handle a pragma='pragma_name=value' URI parameter.
Browse files Browse the repository at this point in the history
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 c178aef
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/providers/spatialite/qgsspatialiteprovider.cpp
Expand Up @@ -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;

Expand Down

0 comments on commit c178aef

Please sign in to comment.