Repository navigation
db.sqlite: change to result return types - #19093
Merged
spytheman merged 8 commits intoAug 10, 2023
Merged
Conversation
β¦stency, and switching to C.sqlite3_errmsg from C.sqlite3_errstr
Update README code example to match new API
Change db.exec() calls to match the new API
spytheman
reviewed
Aug 9, 2023
spytheman
reviewed
Aug 9, 2023
spytheman
reviewed
Aug 9, 2023
spytheman
reviewed
Aug 9, 2023
spytheman
reviewed
Aug 9, 2023
spytheman
reviewed
Aug 9, 2023
spytheman
reviewed
Aug 9, 2023
Change error handling Co-authored-by: Delyan Angelov <delian66@gmail.com>
Contributor
Author
|
Thank you @spytheman |
Contributor
Author
|
I just realized that my commit that changed the doc comments for updated functions got pushed to the wrong branch. I will get those doc comments updated as soon as I can. Sorry about that |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes: #19084
This change brings db.sqlite up to speed with the rest of the db modules by returning
resulttypes where it makes sense. Mostly inexecand other methods that call exec.Because this is a breaking change fixes also had to be applied across tests in the
orm, anddbmodules. Along with fixing some code in v/examples to handle the new return types.In addition to change the return types,
sqlite3_errstrwas swapped out in favor ofsqlite3_errmsgto give more verbose errors for methods where that makes sense, andsqlite.error_messagewas used where that made the most sense.π€ Generated by Copilot at 881fbb6
This pull request improves the error handling of the sqlite module and its users by using the
!operator and theerror_messagemethod. It also fixes some minor issues with thesqlite3_errmsgfunction and theq_intfallback value. It updates the test and example files to reflect the changes.π€ Generated by Copilot at 881fbb6
exec_oneandexec_param_manyfunctions in thevlib/db/sqlite/sqlite_test.vfile, which execute a single query and a batch of queries with parameters, respectively (link, link)