Skip to content

Conversation

@BogdanYarotsky
Copy link
Contributor

@BogdanYarotsky BogdanYarotsky commented Jan 5, 2023

Hi @roji, @vonzshik,

Changes resolve #3383 by adding non-generic Map/UnmapEnum methods to INpgsqlTypeMapper.

This PR replaces the old one - #4629.
Since ConnectorTypeMapper was removed, it was easier to create a new one.
I took all comments from the previous pull request into account.

Best regards and Happy New Year :)
Bogdan

@BogdanYarotsky
Copy link
Contributor Author

Hey @roji,

Just wanted to check in with you about the refactoring in NpgsqlDataSourceBuilder. I noticed that most of the code is in NpgsqlSlimDataSourceBuilder now. Do you think it would make sense for me to move the non-generic enum methods there? Or are there still more changes planned for this module?

Sorry if these are silly questions. I'm pretty new to open-source contributions and just want to make sure I'm doing things correctly. I'm excited to merge my changes with the main branch and tackle the next issue!

Thanks so much for your help.

@roji
Copy link
Member

roji commented Apr 24, 2023

@BogdanYarotsky your questions aren't silly at all, they make total sense. And sorry we haven't already reviewed and merged your PR, there's just a lot going on.

We've refactored NpgsqlDataSourceBuilder to be mostly a wrapped around NpgsqlSlimDataSourceBuilder, which automatically opts into various features that people don't necessarily want when working in NativeAOT mode (either because they aren't compatible with NativeAOT, or because they increase the size and should be opt-in). So you should follow the same pattern and do the implementation in NpgsqlSlimDataSourceBuilder, with a wrapping in NpgsqlDataSourceBuilder. Basically follow what you see for the generic version.

@BogdanYarotsky
Copy link
Contributor Author

@roji thank you for the heads-up! I'll keep this in mind and will update the PR this week.

@BogdanYarotsky
Copy link
Contributor Author

Hi @roji,
Can you please take a look at the PR? I think it is ready for a merge. I have noticed that NpgsqlDataSourceBuilder EnumUnmap methods had no unit tests so I added some. I used existing GlobalTypeMapper tests as an example. Please let me know if more changes are needed.

@NinoFloris NinoFloris force-pushed the 3383-non-generic-enum-mapping-v2 branch 2 times, most recently from d2bddaa to 02d8578 Compare October 4, 2023 17:55
@NinoFloris
Copy link
Member

@BogdanYarotsky I've fixed all the conflicts and updated the branch to be rebased on main. There were quite some changes here after #5123. We should be able to merge it some time soon!

@BogdanYarotsky
Copy link
Contributor Author

@NinoFloris that's great news! Thank you for the rebase and the info 🙂 Just ping me if an action is needed from my side.

@NinoFloris NinoFloris force-pushed the 3383-non-generic-enum-mapping-v2 branch from 02d8578 to 4eb9273 Compare November 7, 2023 17:49
@NinoFloris NinoFloris enabled auto-merge (squash) November 7, 2023 17:52
@NinoFloris NinoFloris merged commit ab0b668 into npgsql:main Nov 7, 2023
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.

Please provide non-generic methods for creating and mapping enums.

3 participants