So in QGIS, GeoPackage will be automatically saved when it is read even if you didn't edit. How to avoid this from happening?
-
1Perhaps by making the .gpkg file as read-only.– user30184Aug 8, 2019 at 20:13
-
1Yep, make it read-only - osgeo-org.1560.x6.nabble.com/…– user2856Aug 8, 2019 at 21:47
-
But this is quite troublesome if you suddenly want to edit those layer of geopackage. I don't quite understand why QGIS need to save it when it is only reading.– Ken TAug 9, 2019 at 3:38
1 Answer
It may have something to do with database file locking and concurrency https://www.sqlite.org/lockingv3.html and the wal mode that QGIS is using https://sqlite.org/wal.html. It might be possible to avoid writing by opening the database as immutable https://sqlite.org/uri.html#uriimmutable but that would require a new option for QGIS. Also you could not suddenly decide to start editing but you should open the database again in readwrite mode.
If you need to know when the GeoPackage was last edited you can have a look at last_change attribute in the gpkg_contents table. Unfortunately I do not believe that QGIS can show that information.