Skip to content
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

DbAdapter = DbAdapter.MySql ignored #116

Closed
jeffsurcess opened this issue Feb 18, 2023 · 5 comments · Fixed by #123
Closed

DbAdapter = DbAdapter.MySql ignored #116

jeffsurcess opened this issue Feb 18, 2023 · 5 comments · Fixed by #123

Comments

@jeffsurcess
Copy link

jeffsurcess commented Feb 18, 2023

I'm getting a Microsoft.Data.SqlClient.SqlException when trying to perform a Respawner.CreateAsync action as below:

            var respawnerOptions = new RespawnerOptions
            {
                DbAdapter = DbAdapter.MySql
            };
            _respawner = await Respawner.CreateAsync(_connectionString, respawnerOptions);

For some reason respawner attempts to make a SQLServer connection; however nowhere in the project is SQLServer used.

Version: Respawn 6.0.0

@MrDave1999
Copy link

I think the problem is this line of code: https://github.com/jbogard/Respawn/blob/master/Respawn/Respawner.cs#L27

@jbogard
Copy link
Owner

jbogard commented Feb 19, 2023 via email

@jochem4207
Copy link

Any news on this? It's breaking the adapter functionality :(

@L968
Copy link

L968 commented Jun 12, 2023

Here's how I managed to work around this issue:

MySqlConnection connection = new MySqlConnection(ConnectionString);
connection.Open();

_respawner = await Respawner.CreateAsync(connection, new RespawnerOptions
{
    DbAdapter = DbAdapter.MySql
});

@jochem4207
Copy link

MySqlConnection connection = new MySqlConnection(ConnectionString);
connection.Open();

_respawner = await Respawner.CreateAsync(connection, new RespawnerOptions
{
DbAdapter = DbAdapter.MySql
});

Thank you! This indeed seems to fix the connection. My tests still failing due duplicate or not existing records. But that's probably a different issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants