-
Notifications
You must be signed in to change notification settings - Fork 933
NH-4017 - Handle Time parameter conversion for newer Npgsql #631
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
…onverting only if Npgsql v3 or higher is loaded.
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
It all looks good, however, I think we need more robust solution to be introduced. |
More robust about the version check or about the conversion? If the version check does not suit you much, I may still split that into two drivers, choose the most up to date as default and then let the user configure the older one if he needs it. |
More robust about setting these parameters. I think we need to move the parameter setup earlier in the pipeline (not sure where as I did not check the code). |
Maybe not easy to do. In the case of failing tests for Npgsql 3 without that changes, earliest in the pipeline would be in the type classes, such as So we will have to check if that could make sens to that at some intermediate stage between types and driver. But in the Npgsql case, having it quite late in the pipeline does not look to me bad: Npgsql does no more accept The other case is SQL Server 2008 and above: I do not know if this case still accepts |
I'm just thinking out loud, feel free to ignore:) MySQL, Sql Server ODBC, and Sybase Advantage Database fail with the same results: they want |
No trouble, having concern about how to do thing reasonably better is always welcome. ("Reasonably" because we say in french "better is enemy of good", meaning wanting to do better while already having something good may lead to bad indeed.) So if we agree it is good enough as is currently, well, I will merge. And maybe do you want to add some task in Jira for redesigning this. |
Can you quick try the solution proposed in NH-3078? |
I have seen it. I expect it to cause other databases to fail. This solution remove the And that will "fix" the Sybase issue only for parameters set by NHibernate from its type classes, not for others. |
I've checked the solution from NH-3078 with following drivers, and it works:
I believe, that it will work for MySql and PostgresSql as well [EDIT]Does not work
PS: It seems that there are no way to set the parameters not through |
It should also work for OracleManagedDataClientDriver. |
Please provide the test case demonstrating the failure outside of TimeType and TimeAsTimeSpanType
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.
Please provide a test case demonstrating the failure outside of TimeType and TimeAsTimeSpanType
Ok, not doable unless diving deep in internals thanks to |
Closing in favor of #637. Feel free to reopen if needed. |
NH-4017 - Handle Time parameter conversion for newer Npgsql
The change appears to be supported by older version of Npgsql, so I am coding it for all instead of checking the Npgsql version and doing it only for v3 and above.