diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000000000..857a5990a --- /dev/null +++ b/.editorconfig @@ -0,0 +1,22 @@ +# Top-most EditorConfig file +root = true + +[*] +indent_style = space +indent_size = 4 +tab_width = 4 +trim_trailing_whitespace = true +insert_final_newline = true +end_of_line = lf + +[*.{csproj,props,build}] +indent_size = 2 + +[*.{cs,vb}] +# Organize usings +dotnet_separate_import_directive_groups = false +dotnet_sort_system_directives_first = true + +[*.cs] +# CS1574: XML comment has cref attribute that could not be resolved +dotnet_diagnostic.CS1574.severity = none diff --git a/.github/workflows/build-pr.yml b/.github/workflows/build-pr.yml new file mode 100644 index 000000000..929a55029 --- /dev/null +++ b/.github/workflows/build-pr.yml @@ -0,0 +1,69 @@ +name: Build & Run Tests for PR +on: + pull_request: + +env: + REPODB_SQLSERVER_CONSTR_MASTER: "Server=tcp:127.0.0.1,41433;Database=master;User ID=sa;Password=ddd53e85-b15e-4da8-91e5-a7d3b00a0ab2;TrustServerCertificate=True;" + REPODB_SQLSERVER_CONSTR_REPODB: "Server=tcp:127.0.0.1,41433;Database=RepoDb;User ID=sa;Password=ddd53e85-b15e-4da8-91e5-a7d3b00a0ab2;TrustServerCertificate=True;" + REPODB_SQLSERVER_CONSTR_REPODBTEST: "Server=tcp:127.0.0.1,41433;Database=RepoDbTest;User ID=sa;Password=ddd53e85-b15e-4da8-91e5-a7d3b00a0ab2;TrustServerCertificate=True;" + REPODB_POSTGRESQL_CONSTR_POSTGRESDB: "Server=127.0.0.1;Port=45432;Database=postgres;User Id=postgres;Password=ddd53e85-b15e-4da8-91e5-a7d3b00a0ab2;" + REPODB_POSTGRESQL_CONSTR: "Server=127.0.0.1;Port=45432;Database=RepoDb;User Id=postgres;Password=ddd53e85-b15e-4da8-91e5-a7d3b00a0ab2;" + REPODB_POSTGRESQL_CONSTR_BULK: "Server=127.0.0.1;Port=45432;Database=RepoDbBulk;User Id=postgres;Password=ddd53e85-b15e-4da8-91e5-a7d3b00a0ab2;" + REPODB_MYSQL_CONSTR_SYS: "Server=127.0.0.1;Port=43306;Database=sys;User ID=root;Password=ddd53e85-b15e-4da8-91e5-a7d3b00a0ab2;" + REPODB_MYSQL_CONSTR_REPODB: "Server=127.0.0.1;Port=43306;Database=RepoDb;User ID=root;Password=ddd53e85-b15e-4da8-91e5-a7d3b00a0ab2;" + REPODB_MYSQL_CONSTR_REPODBTEST: "Server=127.0.0.1;Port=43306;Database=RepoDbTest;User ID=root;Password=ddd53e85-b15e-4da8-91e5-a7d3b00a0ab2;" + +jobs: + build: + runs-on: ubuntu-latest + + # Services. See docker-compose.yml + services: + mssql: + image: mcr.microsoft.com/mssql/server:2022-latest + ports: + - 127.0.0.1:41433:1433 + env: + ACCEPT_EULA: true + MSSQL_SA_PASSWORD: ddd53e85-b15e-4da8-91e5-a7d3b00a0ab2 + + postgresql: + image: postgres:latest + ports: + - 127.0.0.1:45432:5432 + env: + POSTGRES_PASSWORD: ddd53e85-b15e-4da8-91e5-a7d3b00a0ab2 + + mysql: + image: mysql:latest + ports: + - 127.0.0.1:43306:3306 + env: + MYSQL_ROOT_PASSWORD: ddd53e85-b15e-4da8-91e5-a7d3b00a0ab2 + + steps: + - name: Check out repository code + uses: actions/checkout@v4 + + - name: Setup .NET Versions + uses: actions/setup-dotnet@v4 + with: + dotnet-version: | + 6.0.x + 7.0.x + 8.0.x + + - name: build + run: dotnet build -c release + + - name: test + run: dotnet test -c release -f net8.0 --no-build -p:TestingPlatformShowTestsFailure=true -p:TestingPlatformCaptureOutput=false + + - name: pack packages + run: dotnet pack -c release -p Version="1.14.0-dev-pr-${{ github.run_number }}" -o release RepoDb.Core/RepoDb.All.sln + + - name: Package nupkg files + uses: actions/upload-artifact@v3 + with: + name: release + path: release/*nupkg diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 000000000..cef059433 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,69 @@ +name: Build & Run Tests (Push) +on: + push + +env: + REPODB_SQLSERVER_CONSTR_MASTER: "Server=tcp:127.0.0.1,41433;Database=master;User ID=sa;Password=ddd53e85-b15e-4da8-91e5-a7d3b00a0ab2;TrustServerCertificate=True;" + REPODB_SQLSERVER_CONSTR_REPODB: "Server=tcp:127.0.0.1,41433;Database=RepoDb;User ID=sa;Password=ddd53e85-b15e-4da8-91e5-a7d3b00a0ab2;TrustServerCertificate=True;" + REPODB_SQLSERVER_CONSTR_REPODBTEST: "Server=tcp:127.0.0.1,41433;Database=RepoDbTest;User ID=sa;Password=ddd53e85-b15e-4da8-91e5-a7d3b00a0ab2;TrustServerCertificate=True;" + REPODB_POSTGRESQL_CONSTR_POSTGRESDB: "Server=127.0.0.1;Port=45432;Database=postgres;User Id=postgres;Password=ddd53e85-b15e-4da8-91e5-a7d3b00a0ab2;" + REPODB_POSTGRESQL_CONSTR: "Server=127.0.0.1;Port=45432;Database=RepoDb;User Id=postgres;Password=ddd53e85-b15e-4da8-91e5-a7d3b00a0ab2;" + REPODB_POSTGRESQL_CONSTR_BULK: "Server=127.0.0.1;Port=45432;Database=RepoDbBulk;User Id=postgres;Password=ddd53e85-b15e-4da8-91e5-a7d3b00a0ab2;" + REPODB_MYSQL_CONSTR_SYS: "Server=127.0.0.1;Port=43306;Database=sys;User ID=root;Password=ddd53e85-b15e-4da8-91e5-a7d3b00a0ab2;" + REPODB_MYSQL_CONSTR_REPODB: "Server=127.0.0.1;Port=43306;Database=RepoDb;User ID=root;Password=ddd53e85-b15e-4da8-91e5-a7d3b00a0ab2;" + REPODB_MYSQL_CONSTR_REPODBTEST: "Server=127.0.0.1;Port=43306;Database=RepoDbTest;User ID=root;Password=ddd53e85-b15e-4da8-91e5-a7d3b00a0ab2;" + +jobs: + build: + runs-on: ubuntu-latest + + # Services. See docker-compose.yml + services: + mssql: + image: mcr.microsoft.com/mssql/server:2022-latest + ports: + - 127.0.0.1:41433:1433 + env: + ACCEPT_EULA: true + MSSQL_SA_PASSWORD: ddd53e85-b15e-4da8-91e5-a7d3b00a0ab2 + + postgresql: + image: postgres:latest + ports: + - 127.0.0.1:45432:5432 + env: + POSTGRES_PASSWORD: ddd53e85-b15e-4da8-91e5-a7d3b00a0ab2 + + mysql: + image: mysql:latest + ports: + - 127.0.0.1:43306:3306 + env: + MYSQL_ROOT_PASSWORD: ddd53e85-b15e-4da8-91e5-a7d3b00a0ab2 + + steps: + - name: Check out repository code + uses: actions/checkout@v4 + + - name: Setup .NET Versions + uses: actions/setup-dotnet@v4 + with: + dotnet-version: | + 6.0.x + 7.0.x + 8.0.x + + - name: build + run: dotnet build -c release RepoDb.Core/RepoDb.All.sln + + - name: test for .Net 8.0 + run: dotnet test -c release -f net8.0 --no-build -p:TestingPlatformShowTestsFailure=true -p:TestingPlatformCaptureOutput=false RepoDb.Core/RepoDb.All.sln + + - name: pack packages + run: dotnet pack -c release -p Version="1.14.0-dev-${{ github.run_number }}" -o release RepoDb.Core/RepoDb.All.sln + + - name: Package nupkg files + uses: actions/upload-artifact@v3 + with: + name: release + path: release/*nupkg diff --git a/Directory.Build.props b/Directory.Build.props index fc92cd4ad..d115e6210 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,13 +1,28 @@ - Michael Camara Pendon + Michael Camara Pendon and others RepoDb RepoDb + 0.0.1-dev default - Copyright © 2020 + Copyright © 2020-2024 https://repodb.net/ Github LICENSE.txt + README.md + true + true + portable + true + annotations + true + true - \ No newline at end of file + + + + true + + + diff --git a/Directory.Packages.props b/Directory.Packages.props new file mode 100644 index 000000000..0b5b6f38d --- /dev/null +++ b/Directory.Packages.props @@ -0,0 +1,43 @@ + + + true + true + $(NoWarn);NU1507 + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/RepoDb.Benchmarks/RepoDb.Benchmarks.PostgreSql/RepoDb.Benchmarks.PostgreSql.csproj b/RepoDb.Benchmarks/RepoDb.Benchmarks.PostgreSql/RepoDb.Benchmarks.PostgreSql.csproj index 497feb51c..3f7703a5d 100644 --- a/RepoDb.Benchmarks/RepoDb.Benchmarks.PostgreSql/RepoDb.Benchmarks.PostgreSql.csproj +++ b/RepoDb.Benchmarks/RepoDb.Benchmarks.PostgreSql/RepoDb.Benchmarks.PostgreSql.csproj @@ -1,24 +1,21 @@  - Exe net6.0;net7.0;net8.0 + false - - - - - - - - - - + + + + + + + + + - - - + \ No newline at end of file diff --git a/RepoDb.Benchmarks/RepoDb.Benchmarks.SqlServer/RepoDb.Benchmarks.SqlServer.csproj b/RepoDb.Benchmarks/RepoDb.Benchmarks.SqlServer/RepoDb.Benchmarks.SqlServer.csproj index 357b438bb..935276dba 100644 --- a/RepoDb.Benchmarks/RepoDb.Benchmarks.SqlServer/RepoDb.Benchmarks.SqlServer.csproj +++ b/RepoDb.Benchmarks/RepoDb.Benchmarks.SqlServer/RepoDb.Benchmarks.SqlServer.csproj @@ -1,24 +1,21 @@  - Exe net6.0;net7.0;net8.0 + false - - - - - - - - + + + + + + + - - - + \ No newline at end of file diff --git a/RepoDb.Core/.editorconfig b/RepoDb.Core/.editorconfig deleted file mode 100644 index 16cd8ca45..000000000 --- a/RepoDb.Core/.editorconfig +++ /dev/null @@ -1,4 +0,0 @@ -[*.cs] - -# CS1574: XML comment has cref attribute that could not be resolved -dotnet_diagnostic.CS1574.severity = none diff --git a/RepoDb.Core/RepoDb.Tests/RepoDb.IntegrationTests/RepoDb.IntegrationTests.csproj b/RepoDb.Core/RepoDb.Tests/RepoDb.IntegrationTests/RepoDb.IntegrationTests.csproj index 4792bb95b..905740377 100644 --- a/RepoDb.Core/RepoDb.Tests/RepoDb.IntegrationTests/RepoDb.IntegrationTests.csproj +++ b/RepoDb.Core/RepoDb.Tests/RepoDb.IntegrationTests/RepoDb.IntegrationTests.csproj @@ -1,10 +1,11 @@  - net6.0;net7.0;net8.0 false + true + true + true - @@ -25,24 +26,18 @@ - - - - - - + + - - - + \ No newline at end of file diff --git a/RepoDb.Core/RepoDb.Tests/RepoDb.UnitTests/RepoDb.UnitTests.csproj b/RepoDb.Core/RepoDb.Tests/RepoDb.UnitTests/RepoDb.UnitTests.csproj index d3f47bf71..1013c1d15 100644 --- a/RepoDb.Core/RepoDb.Tests/RepoDb.UnitTests/RepoDb.UnitTests.csproj +++ b/RepoDb.Core/RepoDb.Tests/RepoDb.UnitTests/RepoDb.UnitTests.csproj @@ -1,10 +1,11 @@  - net6.0;net7.0;net8.0 false + true + true + true - @@ -15,17 +16,13 @@ - - - - - - + + + - - + \ No newline at end of file diff --git a/RepoDb.Core/RepoDb/RepoDb.csproj b/RepoDb.Core/RepoDb/RepoDb.csproj index 73ba09b1b..c3c702b34 100644 --- a/RepoDb.Core/RepoDb/RepoDb.csproj +++ b/RepoDb.Core/RepoDb/RepoDb.csproj @@ -1,60 +1,45 @@  - - - RepoDB - netstandard2.0;net6.0;net7.0;net8.0 - 0.0.1 - 0.0.1 - 0.0.1 - A hybrid ORM library for .NET. - orm hybrid-orm micro-orm - http://repodb.net/release/core - https://repodb.net/ - https://github.com/mikependon/RepoDb/tree/master/RepoDb.Core - True - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - True - - - - - - - - <_Parameter1>RepoDb.UnitTests - - - - - - - - \ No newline at end of file + + RepoDB + netstandard2.0;net6.0;net7.0;net8.0 + annotations + A hybrid ORM library for .NET. + orm hybrid-orm micro-orm + http://repodb.net/release/core + https://repodb.net/ + https://github.com/mikependon/RepoDb/tree/master/RepoDb.Core + + + + $(NoWarn);CS8604 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/RepoDb.Extensions/RepoDb.PostgreSql.BulkOperations/RepoDb.PostgreSql.BulkOperations.IntegrationTests/RepoDb.PostgreSql.BulkOperations.IntegrationTests.csproj b/RepoDb.Extensions/RepoDb.PostgreSql.BulkOperations/RepoDb.PostgreSql.BulkOperations.IntegrationTests/RepoDb.PostgreSql.BulkOperations.IntegrationTests.csproj index f34dd3ade..739198bb4 100644 --- a/RepoDb.Extensions/RepoDb.PostgreSql.BulkOperations/RepoDb.PostgreSql.BulkOperations.IntegrationTests/RepoDb.PostgreSql.BulkOperations.IntegrationTests.csproj +++ b/RepoDb.Extensions/RepoDb.PostgreSql.BulkOperations/RepoDb.PostgreSql.BulkOperations.IntegrationTests/RepoDb.PostgreSql.BulkOperations.IntegrationTests.csproj @@ -1,28 +1,24 @@  - net6.0;net7.0;net8.0 false + true + true + true - - - - - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - diff --git a/RepoDb.Extensions/RepoDb.PostgreSql.BulkOperations/RepoDb.PostgreSql.BulkOperations.IntegrationTests/Setup/Database.cs b/RepoDb.Extensions/RepoDb.PostgreSql.BulkOperations/RepoDb.PostgreSql.BulkOperations.IntegrationTests/Setup/Database.cs index 3fd17a1c4..ee29fe7b5 100644 --- a/RepoDb.Extensions/RepoDb.PostgreSql.BulkOperations/RepoDb.PostgreSql.BulkOperations.IntegrationTests/Setup/Database.cs +++ b/RepoDb.Extensions/RepoDb.PostgreSql.BulkOperations/RepoDb.PostgreSql.BulkOperations.IntegrationTests/Setup/Database.cs @@ -1,5 +1,5 @@ -using Npgsql; -using System; +using System; +using Npgsql; namespace RepoDb.IntegrationTests.Setup { @@ -13,12 +13,20 @@ public static class Database /// public static void Initialize() { - // Set the connection string - ConnectionStringForPosgres = Environment.GetEnvironmentVariable("REPODB_CONSTR_POSTGRESDB", EnvironmentVariableTarget.Process) ?? - "Server=127.0.0.1;Port=5432;Database=postgres;User Id=postgres;Password=Password123;"; - ConnectionStringForRepoDb = Environment.GetEnvironmentVariable("REPODB_CONSTR", EnvironmentVariableTarget.Process)?? - "Server=127.0.0.1;Port=5432;Database=RepoDb;User Id=postgres;Password=Password123;"; - + // Master connection + ConnectionStringForPostgres = + Environment.GetEnvironmentVariable("REPODB_POSTGRESQL_CONSTR_POSTGRESDB") + ?? Environment.GetEnvironmentVariable("REPODB_CONSTR_POSTGRESDB") + //?? "Server=127.0.0.1;Port=45432;Database=postgres;User Id=postgres;Password=ddd53e85-b15e-4da8-91e5-a7d3b00a0ab2;" // Docker test configuration + ?? "Server=127.0.0.1;Port=5432;Database=postgres;User Id=postgres;Password=Password123;"; + + // RepoDb connection + ConnectionStringForRepoDb = + Environment.GetEnvironmentVariable("REPODB_POSTGRESQL_CONSTR_BULK") + ?? Environment.GetEnvironmentVariable("REPODB_CONSTR_BULK") + //?? "Server=127.0.0.1;Port=45432;Database=RepoDbBulk;User Id=postgres;Password=ddd53e85-b15e-4da8-91e5-a7d3b00a0ab2;" // Docker test configuration + ?? "Server=127.0.0.1;Port=5432;Database=RepoDbBulk;User Id=postgres;Password=Password123;"; + // Initialize PostgreSql GlobalConfiguration.Setup().UsePostgreSql(); @@ -32,7 +40,7 @@ public static void Initialize() /// /// Gets or sets the connection string to be used for Postgres database. /// - public static string ConnectionStringForPosgres { get; private set; } + public static string ConnectionStringForPostgres { get; private set; } /// /// Gets or sets the connection string to be used. @@ -46,12 +54,12 @@ public static void Initialize() /// public static void CreateDatabase() { - using (var connection = new NpgsqlConnection(ConnectionStringForPosgres)) + using (var connection = new NpgsqlConnection(ConnectionStringForPostgres)) { - var recordCount = connection.ExecuteScalar("SELECT COUNT(*) FROM pg_database WHERE datname = 'RepoDb';"); + var recordCount = connection.ExecuteScalar("SELECT COUNT(*) FROM pg_database WHERE datname = 'RepoDbBulk';"); if (recordCount <= 0) { - connection.ExecuteNonQuery(@"CREATE DATABASE ""RepoDb"" + connection.ExecuteNonQuery(@"CREATE DATABASE ""RepoDbBulk"" WITH OWNER = ""postgres"" ENCODING = ""UTF8"" CONNECTION LIMIT = -1;"); diff --git a/RepoDb.Extensions/RepoDb.PostgreSql.BulkOperations/RepoDb.PostgreSql.BulkOperations/RepoDb.PostgreSql.BulkOperations.csproj b/RepoDb.Extensions/RepoDb.PostgreSql.BulkOperations/RepoDb.PostgreSql.BulkOperations/RepoDb.PostgreSql.BulkOperations.csproj index 5050e1ebf..23f304422 100644 --- a/RepoDb.Extensions/RepoDb.PostgreSql.BulkOperations/RepoDb.PostgreSql.BulkOperations/RepoDb.PostgreSql.BulkOperations.csproj +++ b/RepoDb.Extensions/RepoDb.PostgreSql.BulkOperations/RepoDb.PostgreSql.BulkOperations/RepoDb.PostgreSql.BulkOperations.csproj @@ -1,39 +1,20 @@  - - - RepoDb.PostgreSql.BulkOperations - netstandard2.0;net6.0;net7.0;net8.0 - 0.0.1 - 0.0.1 - 0.0.1 - An extension library that contains the official Bulk Operations of RepoDb for PostgreSQL. - orm hybrid-orm micro-orm postgresql bulkoperations - https://github.com/mikependon/RepoDb/tree/master/RepoDb.Extensions/RepoDb.PostgreSql.BulkOperations - http://repodb.net/release/postgresqlbulk - true - true - https://repodb.net/tutorial/get-started-postgresql - - - - - - - - - - True - - - - - - - - - - - - - + + RepoDb.PostgreSql.BulkOperations + netstandard2.0;net6.0;net7.0;net8.0 + annotations + An extension library that contains the official Bulk Operations of RepoDb for PostgreSQL. + orm hybrid-orm micro-orm postgresql bulkoperations + https://github.com/mikependon/RepoDb/tree/master/RepoDb.Extensions/RepoDb.PostgreSql.BulkOperations + http://repodb.net/release/postgresqlbulk + https://repodb.net/tutorial/get-started-postgresql + + + + + + + + + diff --git a/RepoDb.Extensions/RepoDb.SqlServer.BulkOperations/RepoDb.SqlServer.BulkOperations.IntegrationTests/RepoDb.SqlServer.BulkOperations.IntegrationTests.csproj b/RepoDb.Extensions/RepoDb.SqlServer.BulkOperations/RepoDb.SqlServer.BulkOperations.IntegrationTests/RepoDb.SqlServer.BulkOperations.IntegrationTests.csproj index 780812c0d..7f376eda0 100644 --- a/RepoDb.Extensions/RepoDb.SqlServer.BulkOperations/RepoDb.SqlServer.BulkOperations.IntegrationTests/RepoDb.SqlServer.BulkOperations.IntegrationTests.csproj +++ b/RepoDb.Extensions/RepoDb.SqlServer.BulkOperations/RepoDb.SqlServer.BulkOperations.IntegrationTests/RepoDb.SqlServer.BulkOperations.IntegrationTests.csproj @@ -1,10 +1,11 @@  - - net6.0;net7.0;net8.0 + net6.0;net7.0;net8.0 false + true + true + true - @@ -19,21 +20,16 @@ - - - - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - + \ No newline at end of file diff --git a/RepoDb.Extensions/RepoDb.SqlServer.BulkOperations/RepoDb.SqlServer.BulkOperations.IntegrationTests/Setup/Database.cs b/RepoDb.Extensions/RepoDb.SqlServer.BulkOperations/RepoDb.SqlServer.BulkOperations.IntegrationTests/Setup/Database.cs index 44f9d7eda..082dc7159 100644 --- a/RepoDb.Extensions/RepoDb.SqlServer.BulkOperations/RepoDb.SqlServer.BulkOperations.IntegrationTests/Setup/Database.cs +++ b/RepoDb.Extensions/RepoDb.SqlServer.BulkOperations/RepoDb.SqlServer.BulkOperations.IntegrationTests/Setup/Database.cs @@ -1,6 +1,6 @@ -using Microsoft.Data.SqlClient; +using System; +using Microsoft.Data.SqlClient; using RepoDb.SqlServer.BulkOperations.IntegrationTests.Models; -using System; namespace RepoDb.IntegrationTests.Setup { @@ -15,15 +15,23 @@ public static class Database public static void Initialize() { // Master connection - ConnectionStringForMaster = Environment.GetEnvironmentVariable("REPODB_CONSTR_MASTER", EnvironmentVariableTarget.Process) ?? - @"Server=(local);Database=master;Integrated Security=SSPI;TrustServerCertificate=True;"; + ConnectionStringForMaster = + Environment.GetEnvironmentVariable("REPODB_SQLSERVER_CONSTR_MASTER") + ?? Environment.GetEnvironmentVariable("REPODB_CONSTR_MASTER") + // ?? @"Server=tcp:127.0.0.1,41433;Database=master;User ID=sa;Password=ddd53e85-b15e-4da8-91e5-a7d3b00a0ab2;TrustServerCertificate=True;" // Docker Test Configuration + ?? @"Server=(local);Database=master;Integrated Security=SSPI;TrustServerCertificate=True;"; // RepoDb connection - ConnectionStringForRepoDb = Environment.GetEnvironmentVariable("REPODB_CONSTR", EnvironmentVariableTarget.Process) ?? - @"Server=(local);Database=RepoDb;Integrated Security=SSPI;TrustServerCertificate=True;"; + ConnectionStringForRepoDb = + Environment.GetEnvironmentVariable("REPODB_SQLSERVER_CONSTR_REPODBTEST") + ?? Environment.GetEnvironmentVariable("REPODB_CONSTR") + // ?? @"Server=tcp:127.0.0.1,41433;Database=RepoDbTest;User ID=sa;Password=ddd53e85-b15e-4da8-91e5-a7d3b00a0ab2;TrustServerCertificate=True;" // Docker Test Configuration + ?? @"Server=(local);Database=RepoDbTest;Integrated Security=SSPI;TrustServerCertificate=True;"; // Initialize the SqlServer - GlobalConfiguration.Setup().UseSqlServer(); + GlobalConfiguration + .Setup() + .UseSqlServer(); // Create the database first CreateDatabase(); @@ -49,9 +57,9 @@ public static void Initialize() /// public static void CreateDatabase() { - var commandText = @"IF (NOT EXISTS(SELECT * FROM sys.databases WHERE name = 'RepoDb')) + var commandText = @"IF (NOT EXISTS(SELECT * FROM sys.databases WHERE name = 'RepoDbTest')) BEGIN - CREATE DATABASE [RepoDb]; + CREATE DATABASE [RepoDbTest]; END"; using (var connection = new SqlConnection(ConnectionStringForMaster).EnsureOpen()) { diff --git a/RepoDb.Extensions/RepoDb.SqlServer.BulkOperations/RepoDb.SqlServer.BulkOperations/RepoDb.SqlServer.BulkOperations.csproj b/RepoDb.Extensions/RepoDb.SqlServer.BulkOperations/RepoDb.SqlServer.BulkOperations/RepoDb.SqlServer.BulkOperations.csproj index 7004d1141..15b5e96db 100644 --- a/RepoDb.Extensions/RepoDb.SqlServer.BulkOperations/RepoDb.SqlServer.BulkOperations/RepoDb.SqlServer.BulkOperations.csproj +++ b/RepoDb.Extensions/RepoDb.SqlServer.BulkOperations/RepoDb.SqlServer.BulkOperations/RepoDb.SqlServer.BulkOperations.csproj @@ -1,49 +1,30 @@  - - - RepoDb.SqlServer.BulkOperations - netstandard2.0;net6.0;net7.0;net8.0 - 0.0.1 - 0.0.1 - 0.0.1 - true - An extension library that contains the official Bulk Operations of RepoDb for SQL Server. - orm hybrid-orm micro-orm sqlserver bulkoperations - https://github.com/mikependon/RepoDb/tree/master/RepoDb.Extensions/RepoDb.SqlServer.BulkOperations - http://repodb.net/release/sqlserverbulk - true - - - - - - - - - - - - - - - - - - - - - True - - - - - - - - - - - - - + + RepoDb.SqlServer.BulkOperations + netstandard2.0;net6.0;net7.0;net8.0 + annotations + An extension library that contains the official Bulk Operations of RepoDb for SQL Server. + orm hybrid-orm micro-orm sqlserver bulkoperations + https://github.com/mikependon/RepoDb/tree/master/RepoDb.Extensions/RepoDb.SqlServer.BulkOperations + http://repodb.net/release/sqlserverbulk + + + + + + + + + + + + + + + + + + + + diff --git a/RepoDb.MySql/RepoDb.MySql.IntegrationTests/DbHelperTests.cs b/RepoDb.MySql/RepoDb.MySql.IntegrationTests/DbHelperTests.cs index 90f6c6ddc..9e4651e5f 100644 --- a/RepoDb.MySql/RepoDb.MySql.IntegrationTests/DbHelperTests.cs +++ b/RepoDb.MySql/RepoDb.MySql.IntegrationTests/DbHelperTests.cs @@ -43,8 +43,9 @@ public void TestDbHelperGetFields() using (var reader = connection.ExecuteReader(@"SELECT COLUMN_NAME AS ColumnName FROM INFORMATION_SCHEMA.COLUMNS WHERE - TABLE_NAME = @TableName - ORDER BY ORDINAL_POSITION;", new { TableName = "CompleteTable" })) + TABLE_NAME = @TableName + AND TABLE_SCHEMA = @TableSchema + ORDER BY ORDINAL_POSITION;", new { TableName = "CompleteTable", TableSchema = connection.Database })) { var fieldCount = 0; @@ -120,8 +121,9 @@ public async Task TestDbHelperGetFieldsAsync() using (var reader = connection.ExecuteReader(@"SELECT COLUMN_NAME AS ColumnName FROM INFORMATION_SCHEMA.COLUMNS WHERE - TABLE_NAME = @TableName - ORDER BY ORDINAL_POSITION;", new { TableName = "CompleteTable" })) + TABLE_NAME = @TableName + AND TABLE_SCHEMA = @TableSchema + ORDER BY ORDINAL_POSITION;", new { TableName = "CompleteTable", TableSchema = connection.Database })) { var fieldCount = 0; diff --git a/RepoDb.MySql/RepoDb.MySql.IntegrationTests/RepoDb.MySql.IntegrationTests.csproj b/RepoDb.MySql/RepoDb.MySql.IntegrationTests/RepoDb.MySql.IntegrationTests.csproj index 53ab57ba0..789415825 100644 --- a/RepoDb.MySql/RepoDb.MySql.IntegrationTests/RepoDb.MySql.IntegrationTests.csproj +++ b/RepoDb.MySql/RepoDb.MySql.IntegrationTests/RepoDb.MySql.IntegrationTests.csproj @@ -1,25 +1,21 @@ - net6.0;net7.0;net8.0 false + true + true + true - portable true - - - - - + + - - - + \ No newline at end of file diff --git a/RepoDb.MySql/RepoDb.MySql.IntegrationTests/Setup/Database.cs b/RepoDb.MySql/RepoDb.MySql.IntegrationTests/Setup/Database.cs index 11d54c872..d69709937 100644 --- a/RepoDb.MySql/RepoDb.MySql.IntegrationTests/Setup/Database.cs +++ b/RepoDb.MySql/RepoDb.MySql.IntegrationTests/Setup/Database.cs @@ -1,7 +1,8 @@ -using RepoDb.MySql.IntegrationTests.Models; -using MySql.Data.MySqlClient; -using System; +using System; using System.Collections.Generic; +using MySql.Data.MySqlClient; +using RepoDb.Exceptions; +using RepoDb.MySql.IntegrationTests.Models; namespace RepoDb.MySql.IntegrationTests.Setup { @@ -25,13 +26,18 @@ public static class Database public static void Initialize() { - // Get the connection string - var connectionStringForSys = Environment.GetEnvironmentVariable("REPODB_CONSTR_SYS", EnvironmentVariableTarget.Process); - var connectionString = Environment.GetEnvironmentVariable("REPODB_CONSTR", EnvironmentVariableTarget.Process); - // Set the connection string - ConnectionStringForSys = (connectionStringForSys ?? @"Server=localhost;Database=sys;Uid=user;Pwd=Password123;"); - ConnectionString = (connectionString ?? @"Server=localhost;Database=RepoDb;Uid=user;Pwd=Password123;"); + ConnectionStringForSys = + Environment.GetEnvironmentVariable("REPODB_MYSQL_CONSTR_SYS") + ?? Environment.GetEnvironmentVariable("REPODB_CONSTR_SYS") + // ?? @"Server=127.0.0.1;Port=43306;Database=sys;User ID=root;Password=ddd53e85-b15e-4da8-91e5-a7d3b00a0ab2;" // Docker test configuration + ?? @"Server=localhost;Database=sys;Uid=user;Pwd=Password123;"; + + ConnectionString = + Environment.GetEnvironmentVariable("REPODB_MYSQL_CONSTR_REPODB") + ?? Environment.GetEnvironmentVariable("REPODB_CONSTR") + // ?? @"Server=127.0.0.1;Port=43306;Database=RepoDb;User ID=root;Password=ddd53e85-b15e-4da8-91e5-a7d3b00a0ab2;" // Docker test configuration + ?? @"Server=localhost;Database=RepoDb;Uid=user;Pwd=Password123;"; // Initialize MySql GlobalConfiguration @@ -49,8 +55,15 @@ public static void Cleanup() { using (var connection = new MySqlConnection(ConnectionString)) { - connection.Truncate(); - connection.Truncate(); + try + { + connection.Truncate(); + connection.Truncate(); + } + catch (MissingFieldsException) + { + // Table does not exist + } } } @@ -90,7 +103,8 @@ private static void CreateDatabase() { using (var connection = new MySqlConnection(ConnectionStringForSys)) { - connection.ExecuteNonQuery(@"CREATE SCHEMA IF NOT EXISTS `RepoDb`;"); + connection.ExecuteNonQuery(@"CREATE DATABASE IF NOT EXISTS `RepoDb`;"); + connection.ExecuteNonQuery(@"GRANT ALL Privileges on RepoDb.* to 'root'@'%';"); } } @@ -108,7 +122,7 @@ private static void CreateCompleteTable() { using (var connection = new MySqlConnection(ConnectionString)) { - connection.ExecuteNonQuery(@"CREATE TABLE IF NOT EXISTS `completetable` + connection.ExecuteNonQuery(@"CREATE TABLE IF NOT EXISTS `CompleteTable` ( `Id` bigint(20) NOT NULL AUTO_INCREMENT, `ColumnVarchar` varchar(256) DEFAULT NULL, @@ -161,7 +175,7 @@ private static void CreateNonIdentityCompleteTable() { using (var connection = new MySqlConnection(ConnectionString)) { - connection.ExecuteNonQuery(@"CREATE TABLE IF NOT EXISTS `nonidentitycompletetable` + connection.ExecuteNonQuery(@"CREATE TABLE IF NOT EXISTS `NonIdentityCompleteTable` ( `Id` bigint(20) NOT NULL, `ColumnVarchar` varchar(256) DEFAULT NULL, diff --git a/RepoDb.MySql/RepoDb.MySql.UnitTests/RepoDb.MySql.UnitTests.csproj b/RepoDb.MySql/RepoDb.MySql.UnitTests/RepoDb.MySql.UnitTests.csproj index fefe2bd55..296b9af06 100644 --- a/RepoDb.MySql/RepoDb.MySql.UnitTests/RepoDb.MySql.UnitTests.csproj +++ b/RepoDb.MySql/RepoDb.MySql.UnitTests/RepoDb.MySql.UnitTests.csproj @@ -1,18 +1,16 @@ - net6.0;net7.0;net8.0 false + true + true + true - - - - + + - - - + \ No newline at end of file diff --git a/RepoDb.MySql/RepoDb.MySql/RepoDb.MySql.csproj b/RepoDb.MySql/RepoDb.MySql/RepoDb.MySql.csproj index 89cf0deb0..3a1285c9c 100644 --- a/RepoDb.MySql/RepoDb.MySql/RepoDb.MySql.csproj +++ b/RepoDb.MySql/RepoDb.MySql/RepoDb.MySql.csproj @@ -1,42 +1,26 @@  - - - RepoDb.MySql - netstandard2.0;net6.0;net7.0;net8.0 - 0.0.1 - 0.0.1 - 0.0.1 - A hybrid .NET ORM library for MySQL (using MySql.Data). - orm hybrid-orm micro-orm mysql - https://github.com/mikependon/RepoDb/tree/master/RepoDb.MySql - http://repodb.net/release/mysql - True - true - https://repodb.net/tutorial/get-started-mysql - - - - - - - - - - - - - - True - - - - - - - - - - - - + + RepoDb.MySql + netstandard2.0;net6.0;net7.0;net8.0 + annotations + A hybrid .NET ORM library for MySQL (using MySql.Data). + orm hybrid-orm micro-orm mysql + https://github.com/mikependon/RepoDb/tree/master/RepoDb.MySql + http://repodb.net/release/mysql + https://repodb.net/tutorial/get-started-mysql + + + + + + + + + + + + + + + diff --git a/RepoDb.MySqlConnector/RepoDb.MySqlConnector.IntegrationTests/DbHelperTests.cs b/RepoDb.MySqlConnector/RepoDb.MySqlConnector.IntegrationTests/DbHelperTests.cs index 904a679fb..5a492d587 100644 --- a/RepoDb.MySqlConnector/RepoDb.MySqlConnector.IntegrationTests/DbHelperTests.cs +++ b/RepoDb.MySqlConnector/RepoDb.MySqlConnector.IntegrationTests/DbHelperTests.cs @@ -43,8 +43,9 @@ public void TestDbHelperGetFields() using (var reader = connection.ExecuteReader(@"SELECT COLUMN_NAME AS ColumnName FROM INFORMATION_SCHEMA.COLUMNS WHERE - TABLE_NAME = @TableName - ORDER BY ORDINAL_POSITION;", new { TableName = "CompleteTable" })) + TABLE_NAME = @TableName + AND TABLE_SCHEMA = @TableSchema + ORDER BY ORDINAL_POSITION;", new { TableName = "CompleteTable", TableSchema = connection.Database })) { var fieldCount = 0; @@ -120,8 +121,9 @@ public async Task TestDbHelperGetFieldsAsync() using (var reader = connection.ExecuteReader(@"SELECT COLUMN_NAME AS ColumnName FROM INFORMATION_SCHEMA.COLUMNS WHERE - TABLE_NAME = @TableName - ORDER BY ORDINAL_POSITION;", new { TableName = "CompleteTable" })) + TABLE_NAME = @TableName + AND TABLE_SCHEMA = @TableSchema + ORDER BY ORDINAL_POSITION;", new { TableName = "CompleteTable", TableSchema = connection.Database })) { var fieldCount = 0; diff --git a/RepoDb.MySqlConnector/RepoDb.MySqlConnector.IntegrationTests/RepoDb.MySqlConnector.IntegrationTests.csproj b/RepoDb.MySqlConnector/RepoDb.MySqlConnector.IntegrationTests/RepoDb.MySqlConnector.IntegrationTests.csproj index 2a790b290..a193c7474 100644 --- a/RepoDb.MySqlConnector/RepoDb.MySqlConnector.IntegrationTests/RepoDb.MySqlConnector.IntegrationTests.csproj +++ b/RepoDb.MySqlConnector/RepoDb.MySqlConnector.IntegrationTests/RepoDb.MySqlConnector.IntegrationTests.csproj @@ -1,25 +1,21 @@ - net6.0;net7.0;net8.0 false + true + true + true - portable true - - - - - + + - - - + \ No newline at end of file diff --git a/RepoDb.MySqlConnector/RepoDb.MySqlConnector.IntegrationTests/Setup/Database.cs b/RepoDb.MySqlConnector/RepoDb.MySqlConnector.IntegrationTests/Setup/Database.cs index 05beae2e8..40c987263 100644 --- a/RepoDb.MySqlConnector/RepoDb.MySqlConnector.IntegrationTests/Setup/Database.cs +++ b/RepoDb.MySqlConnector/RepoDb.MySqlConnector.IntegrationTests/Setup/Database.cs @@ -1,7 +1,7 @@ -using RepoDb.MySqlConnector.IntegrationTests.Models; -using MySqlConnector; -using System; +using System; using System.Collections.Generic; +using MySqlConnector; +using RepoDb.MySqlConnector.IntegrationTests.Models; namespace RepoDb.MySqlConnector.IntegrationTests.Setup { @@ -25,13 +25,17 @@ public static class Database public static void Initialize() { - // Get the connection string - var connectionStringForSys = Environment.GetEnvironmentVariable("REPODB_CONSTR_SYS", EnvironmentVariableTarget.Process); - var connectionString = Environment.GetEnvironmentVariable("REPODB_CONSTR", EnvironmentVariableTarget.Process); - - // Set the connection string - ConnectionStringForSys = (connectionStringForSys ?? @"Server=localhost;Database=sys;Uid=user;Pwd=Password123;"); - ConnectionString = (connectionString ?? @"Server=localhost;Database=RepoDb;Uid=user;Pwd=Password123;"); + ConnectionStringForSys = + Environment.GetEnvironmentVariable("REPODB_MYSQL_CONSTR_SYS") + ?? Environment.GetEnvironmentVariable("REPODB_CONSTR_SYS") + // ?? @"Server=127.0.0.1;Port=43306;Database=sys;User ID=root;Password=ddd53e85-b15e-4da8-91e5-a7d3b00a0ab2;" // Docker test configuration + ?? @"Server=localhost;Database=sys;Uid=user;Pwd=Password123;"; + + ConnectionString = + Environment.GetEnvironmentVariable("REPODB_MYSQL_CONSTR_REPODBTEST") + ?? Environment.GetEnvironmentVariable("REPODB_CONSTR") + // ?? @"Server=127.0.0.1;Port=43306;Database=RepoDbTest;User ID=root;Password=ddd53e85-b15e-4da8-91e5-a7d3b00a0ab2;" // Docker test configuration + ?? @"Server=localhost;Database=RepoDbTest;Uid=user;Pwd=Password123;"; // Initialize MySql GlobalConfiguration @@ -90,7 +94,8 @@ private static void CreateDatabase() { using (var connection = new MySqlConnection(ConnectionStringForSys)) { - connection.ExecuteNonQuery(@"CREATE SCHEMA IF NOT EXISTS `RepoDb`;"); + connection.ExecuteNonQuery(@"CREATE DATABASE IF NOT EXISTS `RepoDbTest`;"); + connection.ExecuteNonQuery(@"GRANT ALL Privileges on RepoDbTest.* to 'root'@'%';"); } } @@ -108,7 +113,7 @@ private static void CreateCompleteTable() { using (var connection = new MySqlConnection(ConnectionString)) { - connection.ExecuteNonQuery(@"CREATE TABLE IF NOT EXISTS `completetable` + connection.ExecuteNonQuery(@"CREATE TABLE IF NOT EXISTS `CompleteTable` ( `Id` bigint(20) NOT NULL AUTO_INCREMENT, `ColumnVarchar` varchar(256) DEFAULT NULL, @@ -161,7 +166,7 @@ private static void CreateNonIdentityCompleteTable() { using (var connection = new MySqlConnection(ConnectionString)) { - connection.ExecuteNonQuery(@"CREATE TABLE IF NOT EXISTS `nonidentitycompletetable` + connection.ExecuteNonQuery(@"CREATE TABLE IF NOT EXISTS `NonIdentityCompleteTable` ( `Id` bigint(20) NOT NULL, `ColumnVarchar` varchar(256) DEFAULT NULL, diff --git a/RepoDb.MySqlConnector/RepoDb.MySqlConnector.UnitTests/RepoDb.MySqlConnector.UnitTests.csproj b/RepoDb.MySqlConnector/RepoDb.MySqlConnector.UnitTests/RepoDb.MySqlConnector.UnitTests.csproj index cea7e2cb9..4d84ac012 100644 --- a/RepoDb.MySqlConnector/RepoDb.MySqlConnector.UnitTests/RepoDb.MySqlConnector.UnitTests.csproj +++ b/RepoDb.MySqlConnector/RepoDb.MySqlConnector.UnitTests/RepoDb.MySqlConnector.UnitTests.csproj @@ -1,18 +1,15 @@ - net6.0;net7.0;net8.0 false + true + true + true - - - - + - - - + \ No newline at end of file diff --git a/RepoDb.MySqlConnector/RepoDb.MySqlConnector/RepoDb.MySqlConnector.csproj b/RepoDb.MySqlConnector/RepoDb.MySqlConnector/RepoDb.MySqlConnector.csproj index fec5b91c8..3ea8b99b3 100644 --- a/RepoDb.MySqlConnector/RepoDb.MySqlConnector/RepoDb.MySqlConnector.csproj +++ b/RepoDb.MySqlConnector/RepoDb.MySqlConnector/RepoDb.MySqlConnector.csproj @@ -1,42 +1,25 @@ - - - RepoDb.MySqlConnector - netstandard2.0;net6.0;net7.0;net8.0 - 0.0.1 - 0.0.1 - 0.0.1 - A hybrid .NET ORM library for MySQL (using MySqlConnector). - orm hybrid-orm micro-orm mysql mysqlconnector - https://github.com/mikependon/RepoDb/tree/master/RepoDb.MySqlConnector - http://repodb.net/release/mysqlconnector - True - true - https://repodb.net/tutorial/get-started-mysql - - - - - - - - - - - - - - True - - - - - - - - - - - - - + + RepoDb.MySqlConnector + netstandard2.0;net6.0;net7.0;net8.0 + annotations + A hybrid .NET ORM library for MySQL (using MySqlConnector). + orm hybrid-orm micro-orm mysql mysqlconnector + https://github.com/mikependon/RepoDb/tree/master/RepoDb.MySqlConnector + http://repodb.net/release/mysqlconnector + https://repodb.net/tutorial/get-started-mysql + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/RepoDb.PostgreSql/RepoDb.PostgreSql.IntegrationTests/RepoDb.PostgreSql.IntegrationTests.csproj b/RepoDb.PostgreSql/RepoDb.PostgreSql.IntegrationTests/RepoDb.PostgreSql.IntegrationTests.csproj index 34ddb070b..68f6bee3c 100644 --- a/RepoDb.PostgreSql/RepoDb.PostgreSql.IntegrationTests/RepoDb.PostgreSql.IntegrationTests.csproj +++ b/RepoDb.PostgreSql/RepoDb.PostgreSql.IntegrationTests/RepoDb.PostgreSql.IntegrationTests.csproj @@ -1,24 +1,17 @@  - net6.0;net7.0;net8.0 false + true + true + true - - - - - + + - - - - - - + - - + \ No newline at end of file diff --git a/RepoDb.PostgreSql/RepoDb.PostgreSql.IntegrationTests/Setup/Database.cs b/RepoDb.PostgreSql/RepoDb.PostgreSql.IntegrationTests/Setup/Database.cs index 30052c3ff..f85b2af2f 100644 --- a/RepoDb.PostgreSql/RepoDb.PostgreSql.IntegrationTests/Setup/Database.cs +++ b/RepoDb.PostgreSql/RepoDb.PostgreSql.IntegrationTests/Setup/Database.cs @@ -1,7 +1,7 @@ -using RepoDb.PostgreSql.IntegrationTests.Models; -using Npgsql; -using System; +using System; using System.Collections.Generic; +using Npgsql; +using RepoDb.PostgreSql.IntegrationTests.Models; namespace RepoDb.PostgreSql.IntegrationTests.Setup { @@ -12,7 +12,7 @@ public static class Database /// /// Gets or sets the connection string to be used for Postgres database. /// - public static string ConnectionStringForPosgres { get; private set; } + public static string ConnectionStringForPostgres { get; private set; } /// /// Gets or sets the connection string to be used. @@ -25,15 +25,19 @@ public static class Database public static void Initialize() { - // Check the connection string - var connectionStringForPosgres = Environment.GetEnvironmentVariable("REPODB_CONSTR_POSTGRESDB", EnvironmentVariableTarget.Process); - var connectionString = Environment.GetEnvironmentVariable("REPODB_CONSTR", EnvironmentVariableTarget.Process); - // Master connection - ConnectionStringForPosgres = (connectionStringForPosgres ?? "Server=127.0.0.1;Port=5432;Database=postgres;User Id=postgres;Password=Password123;"); + ConnectionStringForPostgres = + Environment.GetEnvironmentVariable("REPODB_POSTGRESQL_CONSTR_POSTGRESDB") + ?? Environment.GetEnvironmentVariable("REPODB_CONSTR_POSTGRESDB") + // ?? "Server=127.0.0.1;Port=45432;Database=postgres;User Id=postgres;Password=ddd53e85-b15e-4da8-91e5-a7d3b00a0ab2;" // Docker test configuration + ?? "Server=127.0.0.1;Port=5432;Database=postgres;User Id=postgres;Password=Password123;"; // RepoDb connection - ConnectionString = (connectionString ?? "Server=127.0.0.1;Port=5432;Database=RepoDb;User Id=postgres;Password=Password123;"); + ConnectionString = + Environment.GetEnvironmentVariable("REPODB_POSTGRESQL_CONSTR") + ?? Environment.GetEnvironmentVariable("REPODB_CONSTR") + // ?? "Server=127.0.0.1;Port=45432;Database=RepoDb;User Id=postgres;Password=ddd53e85-b15e-4da8-91e5-a7d3b00a0ab2;" // Docker test configuration + ?? "Server=127.0.0.1;Port=5432;Database=RepoDb;User Id=postgres;Password=Password123;"; // For >= v6.0.0: To reutilize the legacy behavior // https://github.com/abpframework/abp/issues/10273 @@ -67,7 +71,7 @@ public static void Cleanup() private static void CreateDatabase() { - using (var connection = new NpgsqlConnection(ConnectionStringForPosgres)) + using (var connection = new NpgsqlConnection(ConnectionStringForPostgres)) { var recordCount = connection.ExecuteScalar("SELECT COUNT(*) FROM pg_database WHERE datname = 'RepoDb';"); if (recordCount <= 0) diff --git a/RepoDb.PostgreSql/RepoDb.PostgreSql.UnitTests/RepoDb.PostgreSql.UnitTests.csproj b/RepoDb.PostgreSql/RepoDb.PostgreSql.UnitTests/RepoDb.PostgreSql.UnitTests.csproj index f0bedfcc8..d7a0b27f6 100644 --- a/RepoDb.PostgreSql/RepoDb.PostgreSql.UnitTests/RepoDb.PostgreSql.UnitTests.csproj +++ b/RepoDb.PostgreSql/RepoDb.PostgreSql.UnitTests/RepoDb.PostgreSql.UnitTests.csproj @@ -1,22 +1,19 @@  - net6.0;net7.0;net8.0 false + true + true + true - - - - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - + \ No newline at end of file diff --git a/RepoDb.PostgreSql/RepoDb.PostgreSql/RepoDb.PostgreSql.csproj b/RepoDb.PostgreSql/RepoDb.PostgreSql/RepoDb.PostgreSql.csproj index d718893d8..2359d738b 100644 --- a/RepoDb.PostgreSql/RepoDb.PostgreSql/RepoDb.PostgreSql.csproj +++ b/RepoDb.PostgreSql/RepoDb.PostgreSql/RepoDb.PostgreSql.csproj @@ -1,42 +1,26 @@  - - - RepoDb.PostgreSql - netstandard2.0;net6.0;net7.0;net8.0 - 0.0.1 - 0.0.1 - 0.0.1 - A hybrid .NET ORM library for PostgreSQL. - orm hybrid-orm micro-orm postgresql npgsql - https://github.com/mikependon/RepoDb/tree/master/RepoDb.PostgreSql - http://repodb.net/release/postgresql - True - true - https://repodb.net/tutorial/get-started-postgresql - - - - - - - - - - - - - - - - - - True - - - - - - - - + + RepoDb.PostgreSql + netstandard2.0;net6.0;net7.0;net8.0 + annotations + A hybrid .NET ORM library for PostgreSQL. + orm hybrid-orm micro-orm postgresql npgsql + https://github.com/mikependon/RepoDb/tree/master/RepoDb.PostgreSql + http://repodb.net/release/postgresql + https://repodb.net/tutorial/get-started-postgresql + + + + + + + + + + + + + + + diff --git a/RepoDb.SQLite.System/RepoDb.SQLite.System.IntegrationTests/RepoDb.SQLite.System.IntegrationTests.csproj b/RepoDb.SQLite.System/RepoDb.SQLite.System.IntegrationTests/RepoDb.SQLite.System.IntegrationTests.csproj index 257e0b44e..30192c6a8 100644 --- a/RepoDb.SQLite.System/RepoDb.SQLite.System.IntegrationTests/RepoDb.SQLite.System.IntegrationTests.csproj +++ b/RepoDb.SQLite.System/RepoDb.SQLite.System.IntegrationTests/RepoDb.SQLite.System.IntegrationTests.csproj @@ -1,18 +1,15 @@ - net6.0;net7.0;net8.0 false + true + true + true - - - - + - - - + \ No newline at end of file diff --git a/RepoDb.SQLite.System/RepoDb.SQLite.System.UnitTests/RepoDb.SQLite.System.UnitTests.csproj b/RepoDb.SQLite.System/RepoDb.SQLite.System.UnitTests/RepoDb.SQLite.System.UnitTests.csproj index 257e0b44e..30192c6a8 100644 --- a/RepoDb.SQLite.System/RepoDb.SQLite.System.UnitTests/RepoDb.SQLite.System.UnitTests.csproj +++ b/RepoDb.SQLite.System/RepoDb.SQLite.System.UnitTests/RepoDb.SQLite.System.UnitTests.csproj @@ -1,18 +1,15 @@ - net6.0;net7.0;net8.0 false + true + true + true - - - - + - - - + \ No newline at end of file diff --git a/RepoDb.SQLite.System/RepoDb.SQLite.System/RepoDb.SQLite.System.csproj b/RepoDb.SQLite.System/RepoDb.SQLite.System/RepoDb.SQLite.System.csproj index 83fa47aad..8efb6749e 100644 --- a/RepoDb.SQLite.System/RepoDb.SQLite.System/RepoDb.SQLite.System.csproj +++ b/RepoDb.SQLite.System/RepoDb.SQLite.System/RepoDb.SQLite.System.csproj @@ -1,44 +1,27 @@  - - - RepoDb.SQLite.System - netstandard2.0;net6.0;net7.0;net8.0 - 0.0.1 - 0.0.1 - 0.0.1 - A hybrid .NET ORM library for SQLite (using System.Data.SQLite.Core). - orm hybrid-orm micro-orm sqlite - https://github.com/mikependon/RepoDb/tree/master/RepoDb.SqLite - http://repodb.net/release/sqlite - True - true - https://repodb.net/tutorial/get-started-sqlite - - - - - - - - - - - - - - - - - - - - True - - - - - - - - + + RepoDb.SQLite.System + netstandard2.0;net6.0;net7.0;net8.0 + annotations + A hybrid .NET ORM library for SQLite (using System.Data.SQLite.Core). + orm hybrid-orm micro-orm sqlite + https://github.com/mikependon/RepoDb/tree/master/RepoDb.SqLite + http://repodb.net/release/sqlite + https://repodb.net/tutorial/get-started-sqlite + + + + + + + + + + + + + + + + diff --git a/RepoDb.SqlServer/RepoDb.SqlServer.IntegrationTests/RepoDb.SqlServer.IntegrationTests.csproj b/RepoDb.SqlServer/RepoDb.SqlServer.IntegrationTests/RepoDb.SqlServer.IntegrationTests.csproj index 78899859b..242671b07 100644 --- a/RepoDb.SqlServer/RepoDb.SqlServer.IntegrationTests/RepoDb.SqlServer.IntegrationTests.csproj +++ b/RepoDb.SqlServer/RepoDb.SqlServer.IntegrationTests/RepoDb.SqlServer.IntegrationTests.csproj @@ -1,23 +1,20 @@  - net6.0;net7.0;net8.0 false + true + true + true - - - - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - + \ No newline at end of file diff --git a/RepoDb.SqlServer/RepoDb.SqlServer.IntegrationTests/Setup/Database.cs b/RepoDb.SqlServer/RepoDb.SqlServer.IntegrationTests/Setup/Database.cs index afa0dd673..509c34425 100644 --- a/RepoDb.SqlServer/RepoDb.SqlServer.IntegrationTests/Setup/Database.cs +++ b/RepoDb.SqlServer/RepoDb.SqlServer.IntegrationTests/Setup/Database.cs @@ -1,8 +1,8 @@ -using RepoDb.SqlServer.IntegrationTests.Models; -using Microsoft.Data.SqlClient; -using System; +using System; using System.Collections.Generic; using System.Data; +using Microsoft.Data.SqlClient; +using RepoDb.SqlServer.IntegrationTests.Models; namespace RepoDb.SqlServer.IntegrationTests.Setup { @@ -27,12 +27,18 @@ public static class Database public static void Initialize() { // Master connection - ConnectionStringForMaster = Environment.GetEnvironmentVariable("REPODB_CONSTR_MASTER", EnvironmentVariableTarget.Process) ?? - @"Server=(local);Database=master;Integrated Security=SSPI;TrustServerCertificate=True;"; + ConnectionStringForMaster = + Environment.GetEnvironmentVariable("REPODB_SQLSERVER_CONSTR_MASTER") + ?? Environment.GetEnvironmentVariable("REPODB_CONSTR_MASTER") + ?? @"Server=tcp:127.0.0.1,41433;Database=master;User ID=sa;Password=ddd53e85-b15e-4da8-91e5-a7d3b00a0ab2;TrustServerCertificate=True;" // Docker Test Configuration + ?? @"Server=(local);Database=master;Integrated Security=SSPI;TrustServerCertificate=True;"; // RepoDb connection - ConnectionString = Environment.GetEnvironmentVariable("REPODB_CONSTR", EnvironmentVariableTarget.Process) ?? - @"Server=(local);Database=RepoDbTest;Integrated Security=SSPI;TrustServerCertificate=True;"; + ConnectionString = + Environment.GetEnvironmentVariable("REPODB_SQLSERVER_CONSTR_REPODBTEST") + ?? Environment.GetEnvironmentVariable("REPODB_CONSTR") + ?? @"Server=tcp:127.0.0.1,41433;Database=RepoDbTest;User ID=sa;Password=ddd53e85-b15e-4da8-91e5-a7d3b00a0ab2;TrustServerCertificate=True;" // Docker Test Configuration + ?? @"Server=(local);Database=RepoDbTest;Integrated Security=SSPI;TrustServerCertificate=True;"; // Initialize the SqlServer GlobalConfiguration diff --git a/RepoDb.SqlServer/RepoDb.SqlServer.UnitTests/RepoDb.SqlServer.UnitTests.csproj b/RepoDb.SqlServer/RepoDb.SqlServer.UnitTests/RepoDb.SqlServer.UnitTests.csproj index 78899859b..242671b07 100644 --- a/RepoDb.SqlServer/RepoDb.SqlServer.UnitTests/RepoDb.SqlServer.UnitTests.csproj +++ b/RepoDb.SqlServer/RepoDb.SqlServer.UnitTests/RepoDb.SqlServer.UnitTests.csproj @@ -1,23 +1,20 @@  - net6.0;net7.0;net8.0 false + true + true + true - - - - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - + \ No newline at end of file diff --git a/RepoDb.SqlServer/RepoDb.SqlServer/RepoDb.SqlServer.csproj b/RepoDb.SqlServer/RepoDb.SqlServer/RepoDb.SqlServer.csproj index b9574fc9a..105b90bfb 100644 --- a/RepoDb.SqlServer/RepoDb.SqlServer/RepoDb.SqlServer.csproj +++ b/RepoDb.SqlServer/RepoDb.SqlServer/RepoDb.SqlServer.csproj @@ -1,38 +1,22 @@  - - - RepoDb.SqlServer - netstandard2.0;net6.0;net7.0;net8.0 - 0.0.1 - 0.0.1 - 0.0.1 - A hybrid .NET ORM library for SQL Server. - orm hybrid-orm micro-orm sqlserver - https://github.com/mikependon/RepoDb/tree/master/RepoDb.SqlServer - http://repodb.net/release/sqlserver - true - true - https://repodb.net/tutorial/get-started-sqlserver - - - - - - - - - - - - - - True - - - - - - - - + + RepoDb.SqlServer + netstandard2.0;net6.0;net7.0;net8.0 + annotations + A hybrid .NET ORM library for SQL Server. + orm hybrid-orm micro-orm sqlserver + https://github.com/mikependon/RepoDb/tree/master/RepoDb.SqlServer + http://repodb.net/release/sqlserver + https://repodb.net/tutorial/get-started-sqlserver + + + + + + + + + + + diff --git a/RepoDb.Sqlite.Microsoft/RepoDb.Sqlite.Microsoft.IntegrationTests/RepoDb.Sqlite.Microsoft.IntegrationTests.csproj b/RepoDb.Sqlite.Microsoft/RepoDb.Sqlite.Microsoft.IntegrationTests/RepoDb.Sqlite.Microsoft.IntegrationTests.csproj index 7d49c82e8..35eb225e8 100644 --- a/RepoDb.Sqlite.Microsoft/RepoDb.Sqlite.Microsoft.IntegrationTests/RepoDb.Sqlite.Microsoft.IntegrationTests.csproj +++ b/RepoDb.Sqlite.Microsoft/RepoDb.Sqlite.Microsoft.IntegrationTests/RepoDb.Sqlite.Microsoft.IntegrationTests.csproj @@ -1,18 +1,15 @@  - net6.0;net7.0;net8.0 false + true + true + true - - - - + - - diff --git a/RepoDb.Sqlite.Microsoft/RepoDb.Sqlite.Microsoft.UnitTests/RepoDb.Sqlite.Microsoft.UnitTests.csproj b/RepoDb.Sqlite.Microsoft/RepoDb.Sqlite.Microsoft.UnitTests/RepoDb.Sqlite.Microsoft.UnitTests.csproj index 7d49c82e8..8f363be69 100644 --- a/RepoDb.Sqlite.Microsoft/RepoDb.Sqlite.Microsoft.UnitTests/RepoDb.Sqlite.Microsoft.UnitTests.csproj +++ b/RepoDb.Sqlite.Microsoft/RepoDb.Sqlite.Microsoft.UnitTests/RepoDb.Sqlite.Microsoft.UnitTests.csproj @@ -1,18 +1,12 @@  - net6.0;net7.0;net8.0 false - - - - + - - - + \ No newline at end of file diff --git a/RepoDb.Sqlite.Microsoft/RepoDb.Sqlite.Microsoft/RepoDb.Sqlite.Microsoft.csproj b/RepoDb.Sqlite.Microsoft/RepoDb.Sqlite.Microsoft/RepoDb.Sqlite.Microsoft.csproj index a1bdecab4..d66925373 100644 --- a/RepoDb.Sqlite.Microsoft/RepoDb.Sqlite.Microsoft/RepoDb.Sqlite.Microsoft.csproj +++ b/RepoDb.Sqlite.Microsoft/RepoDb.Sqlite.Microsoft/RepoDb.Sqlite.Microsoft.csproj @@ -1,46 +1,27 @@  - - - RepoDb.Sqlite.Microsoft - netstandard2.0;net6.0;net7.0;net8.0 - 0.0.1 - 0.0.1 - 0.0.1 - A hybrid .NET ORM library for SQLite (using Microsoft.Data.Sqlite). - orm hybrid-orm micro-orm sqlite - https://github.com/mikependon/RepoDb/tree/master/RepoDb.SqLite - http://repodb.net/release/sqlite - True - true - https://repodb.net/tutorial/get-started-sqlite - RepoDb.Sqlite.Microsoft - RepoDb.Sqlite.Microsoft - - - - - - - - - - - - - - - - - - - - True - - - - - - - - + + RepoDb.Sqlite.Microsoft + netstandard2.0;net6.0;net7.0;net8.0 + annotations + A hybrid .NET ORM library for SQLite (using Microsoft.Data.Sqlite). + orm hybrid-orm micro-orm sqlite + https://github.com/mikependon/RepoDb/tree/master/RepoDb.SqLite + http://repodb.net/release/sqlite + https://repodb.net/tutorial/get-started-sqlite + + + + + + + + + + + + + + + + diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 000000000..f0711955e --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,23 @@ +services: + + mssql: + image: mcr.microsoft.com/mssql/server:2022-latest + ports: + - 127.0.0.1:41433:1433 + environment: + ACCEPT_EULA: true + MSSQL_SA_PASSWORD: ddd53e85-b15e-4da8-91e5-a7d3b00a0ab2 + + postgresql: + image: postgres:latest + ports: + - 127.0.0.1:45432:5432 + environment: + POSTGRES_PASSWORD: ddd53e85-b15e-4da8-91e5-a7d3b00a0ab2 + + mysql: + image: mysql:latest + ports: + - 127.0.0.1:43306:3306 + environment: + MYSQL_ROOT_PASSWORD: ddd53e85-b15e-4da8-91e5-a7d3b00a0ab2 \ No newline at end of file diff --git a/test-docker.ps1 b/test-docker.ps1 new file mode 100644 index 000000000..aca7d25c6 --- /dev/null +++ b/test-docker.ps1 @@ -0,0 +1,31 @@ +# Start instances of all database engines in clean docker instances +docker compose down +docker compose up -d + +# Build all test project +foreach ($test in $tests) { + dotnet build $test -f $framework + if(-not $?){ + Exit(1) + } +} + +# SqlServer SA +$env:REPODB_SQLSERVER_CONSTR_MASTER="Server=tcp:127.0.0.1,41433;Database=master;User ID=sa;Password=ddd53e85-b15e-4da8-91e5-a7d3b00a0ab2;TrustServerCertificate=True;" +# RepoDb common integration tests +$env:REPODB_SQLSERVER_CONSTR_REPODB="Server=tcp:127.0.0.1,41433;Database=RepoDb;User ID=sa;Password=ddd53e85-b15e-4da8-91e5-a7d3b00a0ab2;TrustServerCertificate=True;" +# SqlServer Tests +$env:REPODB_SQLSERVER_CONSTR_REPODBTEST="Server=tcp:127.0.0.1,41433;Database=RepoDbTest;User ID=sa;Password=ddd53e85-b15e-4da8-91e5-a7d3b00a0ab2;TrustServerCertificate=True;" +$env:REPODB_POSTGRESQL_CONSTR_POSTGRESDB="Server=127.0.0.1;Port=45432;Database=postgres;User Id=postgres;Password=ddd53e85-b15e-4da8-91e5-a7d3b00a0ab2;" +$env:REPODB_POSTGRESQL_CONSTR="Server=127.0.0.1;Port=45432;Database=RepoDb;User Id=postgres;Password=ddd53e85-b15e-4da8-91e5-a7d3b00a0ab2;" +$env:REPODB_POSTGRESQL_CONSTR_BULK="Server=127.0.0.1;Port=45432;Database=RepoDbBulk;User Id=postgres;Password=ddd53e85-b15e-4da8-91e5-a7d3b00a0ab2;" +$env:REPODB_MYSQL_CONSTR_SYS="Server=127.0.0.1;Port=43306;Database=sys;User ID=root;Password=ddd53e85-b15e-4da8-91e5-a7d3b00a0ab2;" +# Mysql Tests +$env:REPODB_MYSQL_CONSTR_REPODB="Server=127.0.0.1;Port=43306;Database=RepoDb;User ID=root;Password=ddd53e85-b15e-4da8-91e5-a7d3b00a0ab2;" +# MySqlConnector Tests +$env:REPODB_MYSQL_CONSTR_REPODBTEST="Server=127.0.0.1;Port=43306;Database=RepoDbTest;User ID=root;Password=ddd53e85-b15e-4da8-91e5-a7d3b00a0ab2;" + +dotnet test $test -f $framework --no-build -p:TestingPlatformShowTestsFailure=true -p:TestingPlatformCaptureOutput=false +if(-not $?){ + Exit(1) +}