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
Make FromSql and FromSqlRow more generic over the backend
This allows each backend to provide a "value" type that is used by
`FromSql`. This is required for Sqlite support. While I can do some
semi-hacky nonsense to make Sqlite work with our current `ToSql`
structure, there's just no way I can make it work with our `FromSql`
structure.
Sqlite only returns c ints from its values, and there's no way I can
know at the row level the number of bytes that are needed for `FromSql`
for that specific sized integer.
This unfortunately means that we can no longer assume that all backends
provide `String: FromSql<VarChar, Self>`. We can bring this requirement
back by changing `String: FromSql<VarChar, Pg>` to something like `Pg:
CanDeserialize<VarChar, String>`. I'm unsure how this will interact with
coherence, and feels significanly less natural than the `NativeSqlType`
change that we made for this.
I will likely make a similar change for `ToSql` in the future to make
Sqlite work in a less hacky manner.
0 commit comments