Skip to content
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

Remove type modifier decoding from Column object #811

Merged
merged 7 commits into from
May 15, 2024
Merged

Conversation

dvarrazzo
Copy link
Member

Type modifier decoding is implemented in the Column class. The code had to know how to decode the fmod value according to different types, therefore it is a maze of ifs and cannot be extended if not changing the code.

Move the parsing to the TypeInfo object, and within it to a TypeModifier sub-object. This way the code to decode the fmod is automatically dispatched according to the type. Different TypeModifier subclasses can parse the different Postgres types that support modifiers.

Close #450.

Copy link
Contributor

@dlax dlax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not very familiar with this part of the code base but those changes look good to me overall.

@dvarrazzo dvarrazzo merged commit 6b10165 into master May 15, 2024
86 checks passed
@dvarrazzo dvarrazzo deleted the refactor-typeinfo branch May 15, 2024 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor: move modifier parsing functions to TypeInfo
2 participants