Skip to content
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

Expose SqliteError::new #3235

Open
ColonelThirtyTwo opened this issue May 17, 2024 · 0 comments
Open

Expose SqliteError::new #3235

ColonelThirtyTwo opened this issue May 17, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@ColonelThirtyTwo
Copy link

Is your feature request related to a problem? Please describe.
SqliteError has a new function that takes a C handle and generates an error using sqlite3_extended_errcode and sqlite3_errmsg, but it's crate-private. This function would be convenient for anyone working with the C API, for example in SqlitePoolOptions::after_connect to register a custom SQLite function, so that they don't have to write sqlx::Error-compatible error handle themselves.

Describe the solution you'd like
Change SqliteError::new to pub and add unsafe to it (it technically should be unsafe even if crate-private since it requires the passed in handle to be valid).

Describe alternatives you've considered
Writing my own boilerplate to get the error code and message myself. But it's boilerplate.

Additional context
N/A

@ColonelThirtyTwo ColonelThirtyTwo added the enhancement New feature or request label May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant