-
Notifications
You must be signed in to change notification settings - Fork 190
Add Record en-/decoder #258
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
Comments
Original comment by Lars Kanis (Bitbucket: larskanis, GitHub: larskanis). The postgres implementation is in rowtypes.c. We need a new Coder type next to |
Original comment by Carlos Ferreira da Silva (Bitbucket: crash-tech, GitHub: crash-tech). Is this still a feature to come? I built this gem PostgreSQL that relies deeply on these advanced features from PostgreSQL, and requires correct decoding and encoding of the data. I've created this override Torque::PostgreSQL::Coder which is basically an extension of the current available Decoder/Encoder. Let me know if I can help with this, the change seems to be pretty simple and maybe I can open a PR for that. |
Original comment by Lars Kanis (Bitbucket: larskanis, GitHub: larskanis). Add PG::RowCoder for en/decoding of Composite Types This implements proper encoder and decoder for Composite Types This adds the following classes:
Fixes #258 |
This implements proper encoder and decoder for Composite Types as described in https://www.postgresql.org/docs/11/rowtypes.html and as requested in https://bitbucket.org/ged/ruby-pg/issues/258 This adds the following classes: * PG::RowCoder < PG::Coder * PG::RowEncoder < PG::RowCoder * PG::RowDecoder < PG::RowCoder * PG::TextEncoder::Row < PG::RowEncoder * PG::TextDecoder::Row < PG::RowDecoder Fixes #258
Original report by Lars Kanis (Bitbucket: larskanis, GitHub: larskanis).
Original post: https://groups.google.com/forum/#!topic/ruby-pg/ikdlp67c5RA
The current implementation of decoders and encoders doesn't support embedded Records of composite type?
What I'd like to do is decode the following example:
The query returns the following values, before decoder:
What I'd like to do is something like the "PG::TextDecoder::Array#decode" method, but with a mix of decoder functions, returning:
The text was updated successfully, but these errors were encountered: