Add PG::RecordCoder for en/decoding of Composite Types#36
Merged
larskanis merged 7 commits intoged:masterfrom Oct 9, 2019
Merged
Add PG::RecordCoder for en/decoding of Composite Types#36larskanis merged 7 commits intoged:masterfrom
larskanis merged 7 commits intoged:masterfrom
Conversation
|
I'm looking forward to this feature! |
602e570 to
44578ba
Compare
07d353a to
b758fa2
Compare
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 ged#258
I think this makes the purpose of the en/decoder more clear and distances from CopyRow coders. So this renames the classes to these: * PG::RecordCoder < PG::Coder * PG::RecordEncoder < PG::RecordCoder * PG::RecordDecoder < PG::RecordCoder * PG::TextEncoder::Record < PG::RecordEncoder * PG::TextDecoder::Record < PG::RecordDecoder
... and add documentation to record encoder and decoder.
Collaborator
Author
|
@ged After almost 3 years of development this is now ready to be reviewed and merged. I accidentally already pushed this patches into the bitbucket default branch and don't know how to remove it from there. If this PR is OK to merge I'll sync github and bitbucket again. |
It is internal only.
ged
approved these changes
Oct 8, 2019
Owner
ged
left a comment
There was a problem hiding this comment.
I can't wait to try this out. I have a project coming up that I'm planning on using this for.
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
I first took
PG::RowCoderas class name, due to theROW(...)expression provided by PostgreSQL. However this is changed in the second commit, since "Row" is too generic in my opinion and could lead to confusion withCopyRow. So I think "Record" expresses this type of data best.Unfortunately the names
PG::CompositeCoder,PG::CompositeDecoderandPG::CompositeEncoderare already in use (since pg-0.18.0). They should have been namedPG::ArrayCoderinstead, but now it's probably too late to change them, since they have been released years ago. Actually I doubt thatPG::CompositeCoderetc. are in use in any external code, but I don't want to break the API for the sake of consistency.