-
Notifications
You must be signed in to change notification settings - Fork 10
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
Upload initial version of NHibernate.MySqlConnector #1
Conversation
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.
- how to build a nuget package
It should be done by the CI. I have enabled AppVeyor. Your PR needs to add an appveyor.yml
file to handle the build. You may have a look at this one as an example.
- should we provide support for multiple frameworks in .csproj (as it uses .netstandard2.0 now)
NHibernate also provides net461 for supporting people with old tooling, and netcoreapp2.0 for supporting some features unavailable in netstandard2.0. There is no need to add netcoreapp2.0 if the project has nothing specific to it to handle. About net461, I think, as you wish.
- what version of NHibernate should I reference in .csproj (now it has 5.2.1 specified)
Likely you should reference the lowest compatible one, to widen who can use it.
|
||
namespace NHibernate.MySqlConector.Driver | ||
{ | ||
public class MySqlConnectorDriver : ReflectionBasedDriver, IEmbeddedBatcherFactoryProvider |
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 a separated assembly, there should be no need to use reflection for resolving the data provider, unkless it is not available as a NuGet package.
If MySqlConnector is available as a NuGet package, better take directly a reference on it, and inherits DriverBase
instead of ReflectionBasedDriver
.
/// Please check <see href="https://github.com/mysql-net/MySqlConnector">MySqlConnector></see> | ||
/// repository for more information. | ||
/// </para> | ||
/// </remarks> |
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.
Indentation glitch. It should be aligned with the constructor.
/// <inheritdoc /> | ||
public override DateTime MinDate => new DateTime(1000, 1, 1); | ||
|
||
System.Type IEmbeddedBatcherFactoryProvider.BatcherFactoryClass => typeof(MySqlClientBatchingBatcherFactory); |
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.
Using MySqlClientBatchingBatcherFactory
does not work when using MySqlConnector. MySqlClientBatchingBatcher
creates a MySqlClientSqlCommandSet
which uses reflection on the MySql.Data
assembly to create a MySqlDataAdapter
and that causes an exception.
All three of those classes will need to be recreated to use the MySqlConnector MySqlDataAdapter instead.
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.
AFAICT there's no need for a specialized batcher. Can just use GenericBatchingBatcherFactory
here.
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.
It does seem that way - I asked the question on the discussion group for NHibernate and it seems the generic batcher is a more recent addition and appears to work find with MySql.
@danspam that is easily out of my competence level.. |
/// message "Expected End of data packet" when a select command is prepared. | ||
/// </remarks> | ||
protected override bool SupportsPreparingCommands => false; | ||
|
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.
MySqlConnector does support preparing commands.
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 it does yet? mysql-net/MySqlConnector#397
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.
It was implemented in 0.43, see here
Any word on whether support for MySqlConnector will be available any time soon? I want to get rid of Oracle's garbage driver. |
Thanks, I've chosen #2 as it has all issues mentioned here resolved. |
This is in response to nhibernate/nhibernate-core#1375
There are a couple of things that I am not sure what to do about: