crawshaw / sqlite

Go SQLite3 driver
ISC License
561 stars 67 forks source link

Bind non-nil empty slices as empty blobs, not NULL #118

Closed israel-lugo closed 2 years ago

israel-lugo commented 3 years ago

stmt.BindBytes(col, make([]byte, 0)) now stores an empty blob, instead of a NULL.

stmt.BindBytes(col, nil) will still store a NULL. This is intentional, to mimic sqlite3_bind_blob's behaviour with NULL pointers.

This fixes #117.

israel-lugo commented 3 years ago

@AdamSLevy Could you please take a look, when possible? This is for #117.