-
-
Notifications
You must be signed in to change notification settings - Fork 31.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor sqlite3 error handler #129928
Labels
extension-modules
C modules in the Modules dir
topic-sqlite3
type-feature
A feature request or enhancement
Comments
erlend-aasland
added a commit
to erlend-aasland/cpython
that referenced
this issue
Feb 10, 2025
Add a private API for raising DB-API compatible exceptions based on the result code of SQLite C APIs. Some APIs do not store the error indicator on the database pointer, so we need to be able to deduce the DB-API compatible exception directly from the error code. - rename _pysqlite_seterror() as set_error_from_db() - introduce set_error_from_code()
erlend-aasland
added a commit
to erlend-aasland/cpython
that referenced
this issue
Feb 10, 2025
Add a private API for raising DB-API compatible exceptions based on the result code of SQLite C APIs. Some APIs do not store the error indicator on the database pointer, so we need to be able to deduce the DB-API compatible exception directly from the error code. - rename _pysqlite_seterror() as set_error_from_db() - introduce set_error_from_code()
erlend-aasland
added a commit
to erlend-aasland/cpython
that referenced
this issue
Feb 10, 2025
…on misuse Consistently raise ProgrammingError if the user tries to create an UDF with an invalid number of parameters.
erlend-aasland
added a commit
to erlend-aasland/cpython
that referenced
this issue
Feb 10, 2025
…on misuse Consistently raise ProgrammingError if the user tries to create an UDF with an invalid number of parameters.
erlend-aasland
added a commit
that referenced
this issue
Feb 11, 2025
…eation (#129941) Consistently raise ProgrammingError if the user tries to create an UDF with an invalid number of parameters.
erlend-aasland
added a commit
that referenced
this issue
Feb 11, 2025
Add a helper for raising DB-API compatible exceptions based on the result code of SQLite C APIs. Some APIs do not store the error indicator on the database pointer, so we need to be able to deduce the DB-API compatible exception directly from the error code. - rename _pysqlite_seterror() as set_error_from_db() - introduce set_error_from_code()
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
extension-modules
C modules in the Modules dir
topic-sqlite3
type-feature
A feature request or enhancement
In most error cases, we can use the error indicator from the SQLite database pointer when we raise exceptions. However, for some SQLite C APIs, we have to use the result code directly. This is the case for some of the blob APIs, where the error indicator is not stored on the database pointer.
Currently, our "set error" handler only handles the case where the error indicator is set on the database pointer. We also need an
Modules/_sqlite
private API for raising exception from the SQLite C API result codes.See also #128507 (comment)
Linked PRs
The text was updated successfully, but these errors were encountered: