Remove runtime panics from unsupported types #856
kriswuollett
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Motivation
I'd like to be able to use
sea-query
in production without the risk of panics and crashing, by transforming panics into Result types where possible. This issue is specifically raised for incompatible data types. For example the docs say thatu64
isn't supported for SQLite, but it doesn't say it will crash your app if you try using it as a query argument:sea-query/sea-query-binder/src/sqlx_sqlite.rs
Lines 34 to 37 in 605ec44
A specific use case would be for sharing some database schema between a SQLite database embedded with a client and a server like PostgreSQL. But also lately developers have been using SQLite on the server-side as well...
Proposed Solutions
sqlx::IntoArguments
sqlx::IntoArguments
as a sentinel value to represent an error since it doesn't support returning a result typesqlx
, supports result type fromIntoArguments
, see Usability improvements to Arguments, IntoArguments traits launchbadge/sqlx#3586Beta Was this translation helpful? Give feedback.
All reactions