I have a SpatiaLite DB that has been used to generate some layers in QGIS (via a PyQGIS script, using the native:extractbyextent processing tool).

Once these layers have been generated, they are saved to GeoPackage files. Once this is done, there are no open layers in QGIS that are connected to this SpatiaLite DB. At least, none that I can see.

However, if I try to modify or delete this DB on the filesystem (Windows), I can't as the file is open in QGIS.

This SpatiaLite DB is not available in the Browser. I just refer directly to the file link in the PyQGIS code eg:

resultOSMLines = processing.run("native:extractbyextent", {
    'CLIP': True,
    'EXTENT': extentStr,
    'INPUT': 'spatialite://dbname=\'E:/geodata/ausosm.db\' table=\"lines\" (geometry)',

Is there a way of closing open SpatiaLite DB connections from within QGIS 3.34.5?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.