touchlab / SQLiter

Minimal multiplatform sqlite library
https://touchlab.co
177 stars 35 forks source link

Support binding an empty ByteArray to a BLOB #92

Closed conradev closed 12 months ago

conradev commented 1 year ago

If you try to bind an empty ByteArray it will crash because ByteArray.refTo(0) cannot find an element at index 0. The solution is to explicitly handle when the ByteArray is empty and to make an empty BLOB.

I looked around to see how other bindings handle it and rusqlite uses sqlite3_bind_zeroblob().

If any changes are needed to get this merged, I am happy to make them, but also feel free to make any changes yourselves!