You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The trait sqlx::Type is not object safe, as it does not take &self in it's two methods fn type_info() -> TypeInfo and fn compatible(ty: TypeInfo) -> bool.
This is a major issue in a project I'm working on (sea-query & sea-orm), as in my case I am passing values as dyn Trait objects, but cannot include sqlx::Type in the trait objects.
The trait
sqlx::Type
is not object safe, as it does not take&self
in it's two methodsfn type_info() -> TypeInfo
andfn compatible(ty: TypeInfo) -> bool
.This is a major issue in a project I'm working on (sea-query & sea-orm), as in my case I am passing values as
dyn Trait
objects, but cannot includesqlx::Type
in the trait objects.For example, my trait has:
But this does not work as
sqlx::Type
cannot be made into a trait object.Another example would be if you had an enum containing many database types:
This cannot be done without adding a generic to the
Value
enum, which in my case needs to be avoided.Is there any kind of workaround possible for this situation? My main use for
QueryValue
is to pass it to.bind(value)
for use in queries.The text was updated successfully, but these errors were encountered: