-
Notifications
You must be signed in to change notification settings - Fork 115
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
fromPGS equivalent for toFields #593
Comments
AsymmetryYeah, the DefaultFromField a b => DefaultFromField (Nullable a) (Maybe b) to automatically generate the code for decoding nullable field types. Since moving from Creating
|
One problem with using |
No kidding, the books I would happily write on that topic if I had the time. Might be worth throwing something in the docs about the historical reasons but not super high priority IMO.
I didn't need an
Hmm, interesting. I mean back to the whole symmetry thing, it's not all that crazy to me that |
Ah yes, Would something like this be helpful to create the makeToToField ::
forall haskell sqlType1 sqlType2.
IsSqlType sqlType2 =>
(haskell -> Column.Field sqlType1) ->
C.ToFields haskell (Column.Field sqlType2) Implemented at: db98600
I'm still confused why escaping should require a trip to the database. Surely there must be a way of escaping that doesn't require knowing any dynamic property of the database! |
In general it seems like there are a fair amount of asymmetries between
FromFields
andToFields
, including the specialDefaultFromField
class, but the asymmetry I'm most concerned with right now is the lack of afromPGSToField
and/orfromPGSFieldRenderer
. It seems like without it I have to reach forunsafeCast
orInternal
modules to serialize a custom type (in my case for PostGIS types). Perhaps with a tutorial (#592) I'll realize i'm missing something, but after following the types around a bit I'm unsure how to get the results I want without unsafe/Internal functions.The text was updated successfully, but these errors were encountered: