-
Notifications
You must be signed in to change notification settings - Fork 877
Add a separate resolver for records #4971
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
Conversation
roji
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One thought... Ideally, if some attempts to read a record but they haven't opted into records, they'd get an informative exception telling them how to enable support (rather than some "unknown/unhandled type" message). This should be possible by having a dummy handler in the built in resolver, right?
4410b90 to
078bba6
Compare
Done. |
roji
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Consider adding a test for the case when records having been enabled (both to ensure they're not enabled by default and to check the exceptione tc.)
Sure. Just FYI with this change we lose about 10kb (we are still in 21kb positive, but yeah) |
|
Just for adding UnsupportedTypeHandler? Seems like a lot :/ But I still think it's important to have a decent experience when using NpgsqlSlimDataSourceBuilder... probably worth it? |
Yep, just for adding. Agree that it seems quite big, though it should be one-time only, so I would say it's still fine to do this. |
|
Added a test and moved a few things around. |
roji
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just some naming and nits
| /// </summary> | ||
| class MiscTypeTests : MultiplexingTestBase | ||
| { | ||
| NpgsqlDataSource _slimWithoutMappingsDataSource = null!; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure there's any point to have these on the class - can just have two tests which each manages its own builder inside the tests.
See e.g. what I did for ranges.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure there's any point to have these on the class - can just have two tests which each manages its own builder inside the tests.
The point was that we're going to split BuiltInTypeResolver in quite a few resolvers. so we can reuse the exact same data source between the tests for each type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As you wish - though I'm not sure it's worth doing that kind of stuff (with class setup/teardown)... Can just as well have every test completely self-contained, adding (or not) exactly what they want on the slim builder
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As you wish - though I'm not sure it's worth doing that kind of stuff (with class setup/teardown)... Can just as well have every test completely self-contained, adding (or not) exactly what they want on the slim builder
Just for you, I've removed them 😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have my eternal gratitude 😉
Part of #4965
This change saves us around 23kb on windows and linux.