-
Notifications
You must be signed in to change notification settings - Fork 71
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
ToField Action typing #265
Comments
Yes, I absolutely do want to implement something like this. However, my circumstances have changed, and I haven't been working on postgresql-simple for some time now; though I do plan on returning to this project someday. I really should bear down and get a simpler new release finished in the meantime, though. Personally, I don't think this instance is that terrible of a hack. And, something along these lines may be necessary for implementing protocol-level parameters, as every such parameter is tagged with a type oid. I haven't investigated all the issues surrounding this, but I would imagine that picking the right type oid is far more critical for binary protocol-level parameters than it is for textual protocol-level parameters. |
Oh, I would point out you can already create something like this more generically (and more robustly):
I'm not sure if I've ever actually used this definition, though I know it's occurred to me several times. That doesn't really address the issue of how to come up with the |
Sometimes PostgreSQL gets confused about types if there's no explicit typing; I've noticed it with a non-empty array (
PGArray
) of enum elements, which gets recognized astext[]
instead ofuser_role[]
in my case. Setting types in queries explicitly is a bit cumbersome in some cases, and it would be handy ifpostgresql-simple
facilitated it. For instance, the following works, but it usesPlain
for something other than its intended purpose as it's described in the documentation (that is, it's a hack):Maybe something like a
Typed Action String
action constructor should be introduced, or thePlain
description should be adjusted. It may be out of scope ofpostgresql-simple
, but seems like ToField is the appropriate place for adding type information.The text was updated successfully, but these errors were encountered: