Skip to content

Commit c178aef

Browse files
committed
[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.
1 parent c3760ec commit c178aef

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/providers/spatialite/qgsspatialiteprovider.cpp

+13
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,19 @@ QgsSpatiaLiteProvider::QgsSpatiaLiteProvider( QString const &uri )
453453
}
454454
sqliteHandle = handle->handle();
455455

456+
if ( sqliteHandle )
457+
{
458+
QStringList pragmaList = anUri.params( "pragma" );
459+
Q_FOREACH ( QString pragma, pragmaList )
460+
{
461+
char* errMsg = nullptr;
462+
int ret = sqlite3_exec( sqliteHandle, ( "PRAGMA " + pragma ).toUtf8(), nullptr, nullptr, &errMsg );
463+
if ( ret != SQLITE_OK )
464+
QgsDebugMsg( QString( "PRAGMA " ) + pragma + QString( " failed : %1" ).arg( errMsg ? errMsg : "" ) );
465+
sqlite3_free( errMsg );
466+
}
467+
}
468+
456469
bool alreadyDone = false;
457470
bool ret = false;
458471

0 commit comments

Comments
 (0)