Generate non-generic write logic with source generators#3513
Merged
roji merged 2 commits intonpgsql:mainfrom Feb 8, 2021
Merged
Generate non-generic write logic with source generators#3513roji merged 2 commits intonpgsql:mainfrom
roji merged 2 commits intonpgsql:mainfrom
Conversation
Member
Author
|
Yep :) But I think it's actually less scary than the previous runtime code generation - whatever happens, happens at build time and you get simple, C# sources out of it. Feels better. |
3 tasks
3 tasks
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.
Removes a lot of ugly runtime code generation with expression trees.
I'm not completely sure if the complexity really is worth it - maybe just doing this manually everywhere makes more sense and is more maintainable (e.g. as in #3507 (review)). But this is just an opt-in mechanism which can be used where it makes sense, or the relevant code can be written manually.
Note that this doesn't cover all cases - some type handlers would have required more work to get their logic source-generated, and it didn't seem worth the effort.
Part of #2940
Part of #3300
/cc @Brar