IreneKnapp / direct-sqlite

MIT License
35 stars 54 forks source link

Add support for enabling extended result codes as default on a connection #103

Closed intolerable closed 11 months ago

intolerable commented 11 months ago

There's one thing that may need to be changed before this can be merged: with extended result codes enabled for a given connection, there are now two possible "success" results (not counting SQLITE_ROW and SQLITE_DONE) -- SQLITE_OK and SQLITE_OK_LOAD_PERMANENTLY -- while Database.SQLite3.Direct.toResult(M) considers anything not exactly SQLITE_OK to be an error. This shouldn't be a problem unless this library adds support for sqlite3_load_extension, though (https://www.sqlite.org/rescode.html#ok_load_permanently), and should be a simple fix (toResult can mask off the 8 least significant bits before comparing to 0).

intolerable commented 11 months ago

I've added an explicit check for the error, and squashed the branch. do you think anything should be done at this point to handle the OK_LOAD_PERMANENTLY case in toResult? if not, this branch should be mergeable -- thank you for your feedback!

jchia commented 11 months ago

The commit message is way too long. I'm going to change the commit message, commit and push.