diff --git a/.env b/.env index d62ba499..d912c066 100644 --- a/.env +++ b/.env @@ -1,5 +1,5 @@ -SOURCE_WASM_FILE_UBUNTU="WasmRunner/obj/release/net8.0/wasi-wasm/wasm/for-publish/WasmRunner.wasm" -SOURCE_WASM_FILE="WasmRunner/bin/Release/net8.0/wasi-wasm/AppBundle/WasmRunner.wasm" +SOURCE_WASM_FILE_UBUNTU="WasmRunner/obj/release/net9.0/wasi-wasm/wasm/for-publish/WasmRunner.wasm" +SOURCE_WASM_FILE="WasmRunner/bin/Release/net9.0/wasi-wasm/AppBundle/WasmRunner.wasm" MYSQL_CONNECTION_STRING="server=localhost;database=tests;user=root" POSTGRES_CONNECTION_STRING="host=localhost;database=tests;username=postgres;password=pass" POSTGRES_USER="postgres" diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f9d007df..19214b74 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,6 +5,7 @@ defaults: env: SQLC_VERSION: 1.27.0 + DOTNET_VERSION: "9.0.x" WASI_SDK_VERSION: 22 on: @@ -28,7 +29,7 @@ jobs: - name: Set up .NET uses: actions/setup-dotnet@v4 with: - dotnet-version: "8.0.x" + dotnet-version: ${{ env.DOTNET_VERSION }} - name: .NET Lint uses: zyactions/dotnet-lint@v1 @@ -55,7 +56,7 @@ jobs: - name: Setup Dotnet uses: actions/setup-dotnet@v4 with: - dotnet-version: '8.0.x' + dotnet-version: ${{ env.DOTNET_VERSION }} - name: install Wasi workload run: dotnet workload install wasi-experimental @@ -70,12 +71,15 @@ jobs: wget https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${{ env.WASI_SDK_VERSION }}/${{ env.WASI_SDK_FILENAME }} tar xf ${{ env.WASI_SDK_FILENAME }} chmod -R 755 ${{ env.WASI_SDK_FILENAME }} + echo "WASI_SDK_PATH=$(pwd)/${{ env.WASI_SDK_FOLDER_NAME }}" >> $GITHUB_ENV - name: Dotnet Wasm Publish shell: bash run: | set -e - WASI_SDK_PATH="$(pwd)/${{ env.WASI_SDK_FOLDER_NAME }}" dotnet publish WasmRunner -c release + ls ${{ env.WASI_SDK_PATH }} + + dotnet publish WasmRunner -c release ./scripts/wasm/copy_plugin_to.sh dist - name: upload wasm plugin as artifact diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 602654a8..4f68f812 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -7,6 +7,9 @@ permissions: contents: write pull-requests: write +env: + DOTNET_VERSION: "9.0.x" + on: push: branches: [ "main" ] @@ -26,7 +29,7 @@ jobs: - name: Set up .NET uses: actions/setup-dotnet@v4 with: - dotnet-version: "8.0.x" + dotnet-version: ${{ env.DOTNET_VERSION }} - name: Updating docs run: ./docs/scripts/generate_all_docs.sh diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 47332900..8d187f6b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -12,6 +12,10 @@ on: - "**" - "!**.md" + +env: + DOTNET_VERSION: "9.0.x" + jobs: unit-tests: name: Unit Tests @@ -19,6 +23,11 @@ jobs: steps: - uses: actions/checkout@v4 + + - name: Setup Dotnet + uses: actions/setup-dotnet@v4 + with: + dotnet-version: ${{ env.DOTNET_VERSION }} - name: Run Tests run: dotnet test SqlcGenCsharpTests @@ -30,6 +39,11 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Setup Dotnet + uses: actions/setup-dotnet@v4 + with: + dotnet-version: ${{ env.DOTNET_VERSION }} + - name: Load .env file uses: xom9ikk/dotenv@v2.3.0 with: diff --git a/CodeGenerator/CodeGenerator.csproj b/CodeGenerator/CodeGenerator.csproj index 354d4b95..b642763e 100644 --- a/CodeGenerator/CodeGenerator.csproj +++ b/CodeGenerator/CodeGenerator.csproj @@ -1,7 +1,7 @@  - net8.0 + net9.0 enable SqlcGenCsharp diff --git a/Drivers/Drivers.csproj b/Drivers/Drivers.csproj index 0b47e221..06cebd4a 100644 --- a/Drivers/Drivers.csproj +++ b/Drivers/Drivers.csproj @@ -1,7 +1,7 @@  - net8.0 + net9.0 enable SqlcGenCsharp.Drivers diff --git a/EndToEndTests/EndToEndTests.csproj b/EndToEndTests/EndToEndTests.csproj index 73ede0de..624496eb 100644 --- a/EndToEndTests/EndToEndTests.csproj +++ b/EndToEndTests/EndToEndTests.csproj @@ -1,7 +1,7 @@  - net8.0 + net9.0 enable SqlcGenCsharpTests diff --git a/Extensions/Extensions.csproj b/Extensions/Extensions.csproj index c09b9c37..7afe7b82 100644 --- a/Extensions/Extensions.csproj +++ b/Extensions/Extensions.csproj @@ -1,7 +1,7 @@  - net8.0 + net9.0 enable enable SqlcGenCsharp diff --git a/GeneratedProtobuf/GeneratedProtobuf.csproj b/GeneratedProtobuf/GeneratedProtobuf.csproj index 73ac6eac..0931067c 100644 --- a/GeneratedProtobuf/GeneratedProtobuf.csproj +++ b/GeneratedProtobuf/GeneratedProtobuf.csproj @@ -1,7 +1,7 @@  - net8.0 + net9.0 enable SqlcGenCsharp diff --git a/LocalRunner/LocalRunner.csproj b/LocalRunner/LocalRunner.csproj index de7b21c0..6d12360d 100644 --- a/LocalRunner/LocalRunner.csproj +++ b/LocalRunner/LocalRunner.csproj @@ -2,7 +2,7 @@ Exe - net8.0 + net9.0 true osx-arm64;linux-x64 SqlcGenCsharp diff --git a/PluginOptions/DotnetFramework.cs b/PluginOptions/DotnetFramework.cs index 76745fcd..bf6c9c18 100644 --- a/PluginOptions/DotnetFramework.cs +++ b/PluginOptions/DotnetFramework.cs @@ -6,6 +6,7 @@ namespace SqlcGenCsharp; public enum DotnetFramework { Dotnet80, + Dotnet90, DotnetStandard20, DotnetStandard21 } @@ -15,6 +16,7 @@ public static class DotnetFrameworkExtensions private static readonly Dictionary EnumToString = new() { { DotnetFramework.Dotnet80, "net8.0" }, + { DotnetFramework.Dotnet90, "net9.0" }, { DotnetFramework.DotnetStandard21, "netstandard2.1" }, { DotnetFramework.DotnetStandard20, "netstandard2.0" } }; @@ -33,6 +35,6 @@ public static DotnetFramework ParseName(string dotnetFramework) public static bool LatestDotnetSupported(this DotnetFramework me) { - return me == DotnetFramework.Dotnet80; + return me == DotnetFramework.Dotnet80 || me == DotnetFramework.Dotnet90; } } \ No newline at end of file diff --git a/PluginOptions/PluginOptions.csproj b/PluginOptions/PluginOptions.csproj index d7bd9779..41c843c2 100644 --- a/PluginOptions/PluginOptions.csproj +++ b/PluginOptions/PluginOptions.csproj @@ -1,7 +1,7 @@  - net8.0 + net9.0 enable SqlcGenCsharp diff --git a/PluginOptions/RawOptions.cs b/PluginOptions/RawOptions.cs index 0efa8bd0..34847a4d 100644 --- a/PluginOptions/RawOptions.cs +++ b/PluginOptions/RawOptions.cs @@ -11,7 +11,7 @@ internal class RawOptions public bool GenerateCsproj { get; init; } = true; // generating .csproj files by default [JsonPropertyName("targetFramework")] - public string TargetFramework { get; init; } = DotnetFramework.Dotnet80.ToName(); + public string TargetFramework { get; init; } = DotnetFramework.Dotnet90.ToName(); [JsonPropertyName("namespaceName")] public string NamespaceName { get; init; } = string.Empty; diff --git a/SqlcGenCsharp/SqlcGenCsharp.csproj b/SqlcGenCsharp/SqlcGenCsharp.csproj index 1c4a022b..a82e9347 100644 --- a/SqlcGenCsharp/SqlcGenCsharp.csproj +++ b/SqlcGenCsharp/SqlcGenCsharp.csproj @@ -1,7 +1,7 @@  - net8.0 + net9.0 enable enable SqlcGenCsharp diff --git a/SqlcGenCsharpTests/SqlcGenCsharpTests.csproj b/SqlcGenCsharpTests/SqlcGenCsharpTests.csproj index 423d6fba..b22ddeda 100644 --- a/SqlcGenCsharpTests/SqlcGenCsharpTests.csproj +++ b/SqlcGenCsharpTests/SqlcGenCsharpTests.csproj @@ -1,7 +1,7 @@ - net8.0 + net9.0 enable enable diff --git a/WasmRunner/WasmRunner.csproj b/WasmRunner/WasmRunner.csproj index 1a6ba729..a1152b09 100644 --- a/WasmRunner/WasmRunner.csproj +++ b/WasmRunner/WasmRunner.csproj @@ -1,6 +1,6 @@ - net8.0 + net9.0 SqlcGenCsharp Exe wasi-wasm diff --git a/docs/ExamplesDocGen/ExampleDocGen.csproj b/docs/ExamplesDocGen/ExampleDocGen.csproj index 3ce92306..d8e974cc 100644 --- a/docs/ExamplesDocGen/ExampleDocGen.csproj +++ b/docs/ExamplesDocGen/ExampleDocGen.csproj @@ -2,7 +2,7 @@ Exe - net8.0 + net9.0 enable enable DocsGenerator diff --git a/examples/MySqlConnectorDapperExample/MySqlConnectorDapperExample.csproj b/examples/MySqlConnectorDapperExample/MySqlConnectorDapperExample.csproj index 6ccf0536..93020cd7 100644 --- a/examples/MySqlConnectorDapperExample/MySqlConnectorDapperExample.csproj +++ b/examples/MySqlConnectorDapperExample/MySqlConnectorDapperExample.csproj @@ -5,7 +5,7 @@ - net8.0 + net9.0 MySqlConnectorDapperExampleGen Library enable diff --git a/examples/MySqlConnectorExample/MySqlConnectorExample.csproj b/examples/MySqlConnectorExample/MySqlConnectorExample.csproj index b4be8a3d..fe981058 100644 --- a/examples/MySqlConnectorExample/MySqlConnectorExample.csproj +++ b/examples/MySqlConnectorExample/MySqlConnectorExample.csproj @@ -5,7 +5,7 @@ - net8.0 + net9.0 MySqlConnectorExampleGen Library enable diff --git a/examples/NpgsqlDapperExample/NpgsqlDapperExample.csproj b/examples/NpgsqlDapperExample/NpgsqlDapperExample.csproj index 4bb64316..805ebf47 100644 --- a/examples/NpgsqlDapperExample/NpgsqlDapperExample.csproj +++ b/examples/NpgsqlDapperExample/NpgsqlDapperExample.csproj @@ -5,7 +5,7 @@ - net8.0 + net9.0 NpgsqlDapperExampleGen Library enable diff --git a/examples/NpgsqlExample/NpgsqlExample.csproj b/examples/NpgsqlExample/NpgsqlExample.csproj index d076798b..1d592eb7 100644 --- a/examples/NpgsqlExample/NpgsqlExample.csproj +++ b/examples/NpgsqlExample/NpgsqlExample.csproj @@ -5,7 +5,7 @@ - net8.0 + net9.0 NpgsqlExampleGen Library enable diff --git a/examples/SqliteDapperExample/SqliteDapperExample.csproj b/examples/SqliteDapperExample/SqliteDapperExample.csproj index 256483af..9e2d53da 100644 --- a/examples/SqliteDapperExample/SqliteDapperExample.csproj +++ b/examples/SqliteDapperExample/SqliteDapperExample.csproj @@ -5,7 +5,7 @@ - net8.0 + net9.0 SqliteDapperExampleGen Library enable diff --git a/examples/SqliteExample/SqliteExample.csproj b/examples/SqliteExample/SqliteExample.csproj index d31ba452..ed458376 100644 --- a/examples/SqliteExample/SqliteExample.csproj +++ b/examples/SqliteExample/SqliteExample.csproj @@ -5,7 +5,7 @@ - net8.0 + net9.0 SqliteExampleGen Library enable diff --git a/sqlc.ci.yaml b/sqlc.ci.yaml index aa9afdd8..cde1d03a 100644 --- a/sqlc.ci.yaml +++ b/sqlc.ci.yaml @@ -14,7 +14,7 @@ sql: out: examples/NpgsqlExample options: useDapper: false - targetFramework: net8.0 + targetFramework: net9.0 generateCsproj: true namespaceName: NpgsqlExampleGen - schema: "examples/config/postgresql/schema.sql" @@ -25,7 +25,7 @@ sql: out: examples/NpgsqlDapperExample options: useDapper: true - targetFramework: net8.0 + targetFramework: net9.0 generateCsproj: true namespaceName: NpgsqlDapperExampleGen - schema: "examples/config/postgresql/schema.sql" @@ -60,7 +60,7 @@ sql: out: examples/MySqlConnectorExample options: useDapper: false - targetFramework: net8.0 + targetFramework: net9.0 generateCsproj: true namespaceName: MySqlConnectorExampleGen - schema: "examples/config/mysql/schema.sql" @@ -71,7 +71,7 @@ sql: out: examples/MySqlConnectorDapperExample options: useDapper: true - targetFramework: net8.0 + targetFramework: net9.0 generateCsproj: true namespaceName: MySqlConnectorDapperExampleGen - schema: "examples/config/mysql/schema.sql" @@ -106,7 +106,7 @@ sql: out: examples/SqliteExample options: useDapper: false - targetFramework: net8.0 + targetFramework: net9.0 generateCsproj: true namespaceName: SqliteExampleGen - schema: "examples/config/sqlite/schema.sql" @@ -117,7 +117,7 @@ sql: out: examples/SqliteDapperExample options: useDapper: true - targetFramework: net8.0 + targetFramework: net9.0 generateCsproj: true namespaceName: SqliteDapperExampleGen - schema: "examples/config/sqlite/schema.sql" diff --git a/sqlc.local.yaml b/sqlc.local.yaml index ba1f13a8..29d17ed3 100644 --- a/sqlc.local.yaml +++ b/sqlc.local.yaml @@ -13,7 +13,7 @@ sql: out: examples/NpgsqlExample options: useDapper: false - targetFramework: net8.0 + targetFramework: net9.0 generateCsproj: true namespaceName: NpgsqlExampleGen - schema: "examples/config/postgresql/schema.sql" @@ -24,7 +24,7 @@ sql: out: examples/NpgsqlDapperExample options: useDapper: true - targetFramework: net8.0 + targetFramework: net9.0 generateCsproj: true namespaceName: NpgsqlDapperExampleGen - schema: "examples/config/postgresql/schema.sql" @@ -59,7 +59,7 @@ sql: out: examples/MySqlConnectorExample options: useDapper: false - targetFramework: net8.0 + targetFramework: net9.0 generateCsproj: true namespaceName: MySqlConnectorExampleGen - schema: "examples/config/mysql/schema.sql" @@ -70,7 +70,7 @@ sql: out: examples/MySqlConnectorDapperExample options: useDapper: true - targetFramework: net8.0 + targetFramework: net9.0 generateCsproj: true namespaceName: MySqlConnectorDapperExampleGen - schema: "examples/config/mysql/schema.sql" @@ -105,7 +105,7 @@ sql: out: examples/SqliteExample options: useDapper: false - targetFramework: net8.0 + targetFramework: net9.0 generateCsproj: true namespaceName: SqliteExampleGen - schema: "examples/config/sqlite/schema.sql" @@ -116,7 +116,7 @@ sql: out: examples/SqliteDapperExample options: useDapper: true - targetFramework: net8.0 + targetFramework: net9.0 generateCsproj: true namespaceName: SqliteDapperExampleGen - schema: "examples/config/sqlite/schema.sql"