-
Notifications
You must be signed in to change notification settings - Fork 3
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
Enable value-level codecs to be used instead of type-level codecs #60
Comments
Yes, that would be nice to have, but it's a bit problematic right now as it requires quite a bit of work.
litUnsafeFromForeign ∷ ∀ col s a. Coerce col ⇒ Foreign → col s a
litUnsafeFromForeign = unsafeFromCol <<< Col <<< EForeign The purpose of codecs or these ad-hoc type classes is to encode/decode records that represent rows in a database. The first problem to tackle is to expose low-level, unsafe API in the postgresql-client as the currently exported functions require these ad-hoc type classes anyway.
The second step would be to implement a generic
In case anyone would want to implement feel free to ask about any details or questions |
Rather than export |
I think so, yes |
Right now, the
WriteForeign
/ReadForeign
andToSQLValue
/FromSQLValue
type classes are used to encode/decode values to/from the underlying database.Could this type-level codec requirement be lessened, so that value-level codecs could be used instead (e.g.
purescript-codec-argonaut
)?If so, I believe the
Table
type could take a record as an additional argument whose fields' values correspond to the codecs to use when encoding/decoding values for a given column.The text was updated successfully, but these errors were encountered: