8000 ISSUE-318 Migrate from System.Data.SqlClient to Microsoft.Data.SqlClient by tom-haines · Pull Request #319 · lecaillon/Evolve · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

ISSUE-318 Migrate from System.Data.SqlClient to Microsoft.Data.SqlClient #319

N 8000 ew 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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/Evolve.Cli/Evolve.Cli.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
<PackageReference Include="CassandraCSharpDriver" Version="3.18.0" />
<PackageReference Include="McMaster.Extensions.CommandLineUtils" Version="3.1.0" />
<PackageReference Include="MySqlConnector" Version="2.1.13" />
<PackageReference Include="Npgsql" Version="6.0.7" />
<PackageReference Include="System.Data.SqlClient" Version="4.8.3" />
<PackageReference Include="System.Data.SQLite.Core" Version="1.0.116" />
<PackageReference Include="Npgsql" Version="8.0.1" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.1.4" />
<PackageReference Include="Microsoft.Data.Sqlite" Version="6.0.12" />
</ItemGroup>

<ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions src/Evolve.Cli/EvolveFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
using System.Collections.Generic;
using System.Data;
using System.Data.Common;
using System.Data.SqlClient;
using System.Data.SQLite;
using Microsoft.Data.SqlClient;
using Microsoft.Data.Sqlite;
using System.Linq;
using System.Reflection;
using System.Text;
Expand Down Expand Up @@ -92,7 +92,7 @@ private static DbConnection CreateConnection(Program options)
cnn = new NpgsqlConnection(cnnStr);
break;
case DBMS.SQLite:
cnn = new SQLiteConnection(cnnStr);
cnn = new SqliteConnection(cnnStr);
break;
case DBMS.SQLServer:
cnn = new SqlConnection(cnnStr) { AccessToken = options.SqlServerAccessToken };
Expand Down
2 changes: 1 addition & 1 deletion src/Evolve.Cli/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
[Command(ResponseFileHandling = ResponseFileHandling.ParseArgsAsSpaceSeparated)]
class Program
{
private static readonly Evolve Default = new(new System.Data.SQLite.SQLiteConnection("Data Source=:memory:"));
private static readonly Evolve Default = new(new Microsoft.Data.Sqlite.SqliteConnection("Data Source=:memory:"));

static int Main(string[] args)
{
Expand Down
6 changes: 3 additions & 3 deletions src/Evolve.Tool/Evolve.Tool.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ Every time you build your project, it will automatically ensure that your databa
<PackageReference Include="CassandraCSharpDriver" Version="3.18.0" />
<PackageReference Include="McMaster.Extensions.CommandLineUtils" Version="3.1.0" />
<PackageReference Include="MySqlConnector" Version="2.1.13" />
<PackageReference Include="Npgsql" Version="6.0.7" />
<PackageReference Include="System.Data.SqlClient" Version="4.8.3" />
<PackageReference Include="System.Data.SQLite.Core" Version="1.0.116" />
<PackageReference Include="Npgsql" Version="8.0.1" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.1.4" />
<PackageReference Include="Microsoft.Data.Sqlite" Version="6.0.12" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions test/Evolve.Tests/Connection/WrappedConnectionTest.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using System;
using System.Data;
using System.Data.SQLite;
using EvolveDb.Connection;
using EvolveDb.Tests.Infrastructure;
using Microsoft.Data.Sqlite;
using Xunit;

namespace EvolveDb.Tests.Connection
Expand Down Expand Up @@ -105,7 +105,7 @@ public void When_dbconnection_is_ok_validation_works()
[Category(Test.Connection)]
public void When_dbconnection_is_not_ok_validation_fails()
{
using var wrappedConnection = new WrappedConnection(new SQLiteConnection("Data Source=:fails"));
using var wrappedConnection = new WrappedConnection(new SqliteConnection("Data Source=:fails"));
Assert.ThrowsAny<Exception>(() => wrappedConnection.Validate());
}

Expand Down
8 changes: 4 additions & 4 deletions test/Evolve.Tests/Evolve.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
<PackageReference Include="altcover" Version="8.6.61" />
<PackageReference Include="CassandraCSharpDriver" Version="3.18.0" />
<PackageReference Include="Docker.DotNet" Version="3.125.15" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="MySqlConnector" Version="2.1.13" />
<PackageReference Include="Npgsql" Version="6.0.7" />
<PackageReference Include="System.Data.SqlClient" Version="4.8.5" />
<PackageReference Include="System.Data.SQLite.Core" Version="1.0.116" />
<PackageReference Include="Npgsql" Version="8.0.1" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.1.4" />
<PackageReference Include="Microsoft.Data.Sqlite" Version="6.0.12" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<PrivateAssets>all</PrivateAssets>
Expand Down
2 changes: 1 addition & 1 deletion test/Evolve.Tests/Infrastructure/SQLServerContainer.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using System.Data.Common;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using System.Threading.Tasks;

namespace EvolveDb.Tests.Infrastructure
Expand Down
1 change: 1 addition & 0 deletions test/Evolve.Tests/Integration/SQLServer/DialectTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using EvolveDb.Dialect.SQLServer;
using EvolveDb.Tests.Infrastructure;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using Xunit;

namespace EvolveDb.Tests.Integration.SQLServer
Expand Down
1 change: 1 addition & 0 deletions test/Evolve.Tests/Integration/SQLServer/MigrationTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using EvolveDb.Tests.Infrastructure;
using System.Collections.Generic;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using Xunit;
using Xunit.Abstractions;
using static EvolveDb.Tests.TestContext;
Expand Down
4 changes: 2 additions & 2 deletions test/Evolve.Tests/Integration/SQLite/MigrationTest.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
using System.Data.SQLite;
using System.IO;
using Microsoft.Data.Sqlite;
using Xunit;
using Xunit.Abstractions;
using static EvolveDb.Tests.TestContext;
Expand All @@ -22,7 +22,7 @@ public MigrationTest(ITestOutputHelper output)
public void Run_all_SQLite_migrations_work()
{
// Arrange
var cnn = new SQLiteConnection($@"Data Source={Path.GetTempPath() + Guid.NewGuid().ToString()}.db;");
var cnn = new SqliteConnection($@"Data Source={Path.GetTempPath() + Guid.NewGuid().ToString()}.db;");
var evolve = new Evolve(cnn, msg => _output.WriteLine(msg))
{
Placeholders = new Dictionary<string, string> { ["${table4}"] = "table_4" },
Expand Down
1 change: 1 addition & 0 deletions test/Evolve.Tests/Integration/ScenarioBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.Data.Common;
using System.Data.SqlClient;
using System.IO;
using Microsoft.Data.SqlClient;
using Xunit.Abstractions;
using static EvolveDb.Tests.TestContext;

Expand Down
8 changes: 4 additions & 4 deletions test/Evolve.Tests/TestUtil.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using System.Data.SqlClient;
using System.Data.SQLite;
using System.IO;
using System.IO;
using System.Text;
using EvolveDb.Connection;
using EvolveDb.Metadata;
using EvolveDb.Migration;
using Microsoft.Data.SqlClient;
using Microsoft.Data.Sqlite;

namespace EvolveDb.Tests
{
Expand All @@ -28,7 +28,7 @@ public static void CreateSqlServerDatabase(string dbName, string cnxStr)
cnn.Close();
}

public static WrappedConnection CreateSQLiteWrappedCnx() => new WrappedConnection(new SQLiteConnection("Data Source=:memory:"));
public static WrappedConnection CreateSQLiteWrappedCnx() => new WrappedConnection(new SqliteConnection("Data Source=:memory:"));

public static FileMigrationScript BuildFileMigrationScript(string path = null, string version = null, string description = null) =>
new FileMigrationScript(
Expand Down
0