Hi guys. I'm working on the read refactoring and have trouble understanding something - you can probably help with that.
The
ADO.NET API supports the idea of a "normal" type and a provider-specific type (GetValue() vs. GetProviderSpecificValue()). Reading the docs, this seems to allow the user to retrieve the column as a special type specific only to the
ADO.NET provider. It seems like exactly what's needed to expose, say, a Postgresql-specific date rather than DateTime.
However, in Npgsql we also have the UseExtendedTypes connection string parameter, which affects what GetValue() returns - if's true you get the provider specific value (from GetValue!. Is there any reason for this, or can we just return the .NET framework value from GetValue(), and Npgsql-specific types from GetProviderSpecificValue()?
There's one last type juggling feature in there - expected types. A command has an ExpectedTypes property which is checked first, and returned data is "coerced" into these types. This feature seems to be used only by the EntityFramework. I know almost nothing about how EntityFramework is implemented, but does this belong inside the Npgsql core? Should EntityFramework have a switch based on its "expected type" and just call the correct GetX() method on the reader (e.g. GetDouble())?
Can you guys help shed some light on this?
Shay