-
Notifications
You must be signed in to change notification settings - Fork 106
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
Can you use dependency on MySqlConnector.net (MIT License) instead of MySql.Data( GPL License) #63
Comments
Thanks for the info. I'll look into this |
I'd appreciate this as well. |
May I know how do you insert scripts? In MySql.Data, the code will be something like this:
What is the equivalent of above code if using MySqlConnector.net? |
I've never done that so far sorry. |
Hi!!
You may look into this discussion:
mysql-net/MySqlConnector#382
Best regards
Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10
From: Adrian Voo<mailto:[email protected]>
Sent: 21 January 2021 16:43
To: MySqlBackupNET/MySqlBackup.Net<mailto:[email protected]>
Cc: himanshukodwani<mailto:[email protected]>; Author<mailto:[email protected]>
Subject: Re: [MySqlBackupNET/MySqlBackup.Net] Can you use dependency on MySqlConnector.net (MIT License) instead of MySql.Data( GPL License) (#63)
May I know how do you insert scripts?
The blocks of SQL statements for creating procedures, functions, etc?
In MySql.Data, the code will be something like this:
string text = @"DELIMITER |
CREATE PROCEDURE `proceduresample1`()
DETERMINISTIC
COMMENT 'A procedure'
BEGIN
SELECT 'Hello World !';
END |";
using (MySqlConnection conn = new MySqlConnection(ConnectionString))
{
MySqlScript script = new MySqlScript(conn);
script.Query = text;
script.Execute();
script = null;
}
What is the equivalent code of if using MySqlConnector.net?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#63 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AJ7O4IRKJR56MIES52J54LTS3AD6ZANCNFSM4QISV3PQ>.
|
Can confirm you can just use a MySQLCommand in MySQLConnector to run multiple things. Using it and was looking for a backup-integration into my software and ended up here ;) In my buildsystem I create different sql files for either full creating of my schema or patching a schema between to versions of my database-schema. I can simply load my file into a string, put it into a MySQLCommand and run it and it'll work as expected running all the create/alter statements in it. From that discussion, MySQLScript from Oracle sounds like a hack to fix a designflaw in their MySQLCommand o.o |
Well, MySqlConnector.Net not support Your sql can remove
|
News ? |
Hi @adriancs2, as i was stuck without it, i made a quick (& maybe dirty) fork supporting it, plus a nuget package. https://github.com/souchprod/MySqlBackup.Net It was mostly about changing the reference to MysqlConnector & using a clone of MysqlScript. |
Hi @souchprod , nice work :) along with additional for support of MySqlConnector.DLL, I have also added some updates, here are the summary: [New]
[Improve]
I did some benchmark between Below is the summary of the benchmark:
I have already released the binaries for You can also download the specific files here for testing: |
Thanks @souchprod and @adrian Voo for the nice work done. Was looking forward to it since long. Take care guys.
Himanshu Kodwani
Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows
From: Adrian ***@***.***>
Sent: 22 September 2021 13:18
To: ***@***.***>
Cc: ***@***.***>; ***@***.***>
Subject: Re: [MySqlBackupNET/MySqlBackup.Net] Can you use dependency on MySqlConnector.net (MIT License) instead of MySql.Data( GPL License) (#63)
Hi @souchprod<https://github.com/souchprod> , nice work :)
I have included the 2 additional files ( MySqlScript.cs and MySqlTokenizer.cs ) and built the DLL. Nice workaround. and thanks.
along with additional for support of MySqlConnector.DLL, I have also added some updates, here are the summary:
[New]
* ExportInformation.EnableComment = true. (new option)
* Added support for MySqlConnector (MIT)
* ExportToFile(), if the directory is not existed. MySqlBackup will attempt to create it.
[Improve]
* ImportInfo.ErrorLogFile = true. Now will include the query that causes the error.
* ExportToFile = Auto created directory if not exists.
* For non delimeter changed query execution, using MySqlCommand in stead of MySqlScript, slightly increase overall import speed.
* Minor clean up.
I did some benchmark between MySqlCommand and MySqlScript, and I found that MySqlCommand is slightly faster than MySqlScript. Therefore, for normal execution, I use MySqlCommand, and for routines creation (store procedures, functions, views, triggers, etc...), I use MySqlScript.
Below is the summary of the benchmark:
Database Size: 380MB
CPU: Intel Core i5
RAM: 12GB
Harddisk: Samsung SSD Evo 860
Time(Avr) Class - DLL
…--- ---
57s mysql.exe (MySqlWorkbench)
1m 5s MySqlCommand - MySql.Data.DLL
1m 5s MySqlCommand - MySqlConnector.DLL
1m 5s MySqlCommand - Devart.Express.MySql.DLL
1m 16s MySqlScript - MySql.Data.DLL
I have already released the binaries for MySqlConnector.DLL. You can download it at:
https://github.com/MySqlBackupNET/MySqlBackup.Net/releases
You can also download the specific files here for testing:
MySqlBackupNet.MySqlConnector (v2.3.5).zip<https://github.com/MySqlBackupNET/MySqlBackup.Net/files/7208737/MySqlBackupNet.MySqlConnector.v2.3.5.zip>
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#63 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AJ7O4ITW3ZIKLHXOPOEUVLLUDGC6BANCNFSM4QISV3PQ>.
Triage notifications on the go with GitHub Mobile for iOS<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Hi @souchprod I would like to upload the new nuget package for MySqlConnector, can you add me as the owner of the package? |
HI @adriancs2 , yep i'll search how to do this now, nice to have the changes included in the original repo and glad to see the other improvements |
MySqlConnector.Net licensing seems to be a better choice for many, also performance-wise it has a slight edge.
The text was updated successfully, but these errors were encountered: