I'm wondering what is the behaviour of qgis when you work on spatialite layers.

For instance what I've discovered so far is that when you split a geometry in two. One remain the original (same id, same attributes) and the other is a duplicata (negative id but still same attributes) that can be modified before the commit. After you save changes there is an insert for the new feature but is there an update for the original feature because it's geometry changed ?

And furthermore, when you merge features i've noticed that no DELETE is emitted to the database.

I'll be glad if someone points me toward some doc about it.


I can't understand how you could remove a feature from SpatiaLite db without DELETE. It might work if QGIS keeps list of deleted features in the memory but at least when the connection in closed the corresponding rows must be deleted. How are you monitoring what happens in the database? Are you aware that QGIS sets the database into WAL mode https://sqlite.org/wal.html and therefore your monitoring session does not see the edits which are waiting for the checkpoint in a write-ahead queue.

  • My bad ! My triggers were not well written so I was surprised that after merging features those that were related to the disappearing ones were not deleted by the triggers i've set.. My guess was wrong but I'm kinda relieved now it works well. – Gingerbread Nov 28 '17 at 15:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.