denodrivers / sqlite3

The fastest and correct SQLite3 module for Deno runtime
https://jsr.io/@db/sqlite
Apache License 2.0
265 stars 22 forks source link

Fix #73. #74

Closed nsf closed 1 year ago

nsf commented 1 year ago

Empty string is encoded as empty buffer in Deno. And as of right now (Deno 1.29.1), ffi layer converts it to NULL pointer, which causes sqlite3_bind_text to bind the NULL value instead of an empty string. As a workaround let's use a special non-empty buffer, but specify zero length.

DjDeveloperr commented 1 year ago

Seems that tests are only failing on this PR, not on main branch although the failure looks unrelated. I will look into this

DjDeveloperr commented 1 year ago

Error only occurs when this newly added test case uses a separate database. Perhaps it is related to some thread safety issues because the only tests that are failing are related to async/non-blocking functionality. Let's use single database in tests for now, I will deprecate/remove the async methods in SQLBlob in a follow up since the functionality doesn't work safely because of how the async calls are made.

nsf commented 1 year ago

Updated the test.