welcome. I checked the source a little bit and I think the problem affects the entire db-layer. I filed an issue about that: [https://github.com/nim-lang/Nim/issues/9453](https://github.com/nim-lang/Nim/issues/9453) The problem has nothing to do with the NULL values - it's just how the sql is parsed and the values are inserted into the sql before invoking execute on the db-side (I always test with latest devel)
I found also other issues how the results are retrieved and iterated (for huge tables or resultsets I think you blow up your memory because internally the entire result set is consumed) I wish I could contribute to that problem but at the moment I am a little bit lack of spare time. I think the first thing would be doing it proper for sqlite3; an then doing a rework on the (generic) db-layer without affecting the actual API
