-
-
Notifications
You must be signed in to change notification settings - Fork 498
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
Pomelo Entity Framework connector is not able to recreate database. #7890
Comments
Do you have a simpler repro? We're not super familiar with these connector. Even the code snippet that's executing when you get the error would help. |
@fulghum is going to poke around for a bit and see if he can repro. He's our .NET specialist. |
Hi @awarycha, awesome to see more .NET developers using Dolt! 🙌 Thank you for taking the time to open a GitHub issue and report this problem. We appreciate hearing feedback about the .NET developer experience with Dolt. We have a small ASP.NET Core sample app using Dolt that I was able to repro this with. You can find the repo on GitHub and there's also a DoltHub blog post explaining it it in more detail. I added this code to the var scope = app.Services.CreateScope();
var context = scope.ServiceProvider.GetRequiredService<DoltContext>();
context.Database.EnsureCreated(); When the database exists, but the schema needs to be created, this seems to work correctly. When the database does not exist at all, I get the error: From looking at the Pomelo code, I believe this is happening because it doesn't recognize the error code Dolt is sending back when Pomelo checks for database existence. I'm going to try a quick experiment to change that error code to what Pomelo is expecting (error code 1049) and see if that makes the error go away. Thanks for reporting this issue. 🙏 I'll keep you updated with what I find next. |
I can confirm that returning error code 1049 for the "database not found" error now allows my repro to correctly create the database and schema using I'm going to clean up my change, add some tests, and get it out for review. |
…ping errors from ComInitDB to MySQL errors with error codes. dolthub/dolt#7890
@awarycha – We've just released Dolt 1.38.3, which contains the fix for this issue. Thank you for taking the time to try out Dolt and report this issue so we could fix it! 🙏 Please let us know if you hit any other snags or have any feedback for us on how we can improve the .NET Dolt experience. |
Great, very fast response. Good job. I can confirm that recreation started working on dolt 1.38.3 and 1.39.0. But I noticed another problem with Pomelo and these versions of Dolt. Pomelo is not able to successfully commit changes. It worked for Dolt dolthub/dolt-sql-server:1.34.0. So it is some kind of regress. I've created new issue for that. #7897 |
I have an ASP.NET application with Dolt in Docker dolthub/dolt-sql-server:1.34.0.
At the beginning I used MySql.EntityFrameworkCore in version 8.0.2 and it worked fine with recreation database structure
with EnsureCreated() method. But I decided to change it to Pomelo package because it has some troubles with merging and conflict resolving in transaction.
So currently I use Pomelo.EntityFrameworkCore.MySql package in version 8.0.2 and it works fine with transaction and merging but appears that there is some problem with database structure recreation.
I get errors:
unhandled exception of type 'MySqlConnector.MySqlException' occurred in Pomelo.EntityFrameworkCore.MySql.dll: 'database not found: mydb'
My dolt is recognized by autodetector as: 8.0.33-mysql
As a workaround currently I use both connectors one MySql.EntityFrameworkCore for database recreation and Pomelo for other operations but I would prefer to use only one of them.
Could you verify that this problem exist also on your side?
The text was updated successfully, but these errors were encountered: