Skip to content
Closed

try #165

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
4 changes: 2 additions & 2 deletions .env
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ defaults:

env:
SQLC_VERSION: 1.27.0
DOTNET_VERSION: "9.0.x"
WASI_SDK_VERSION: 22

on:
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ permissions:
contents: write
pull-requests: write

env:
DOTNET_VERSION: "9.0.x"

on:
push:
branches: [ "main" ]
Expand All @@ -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
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,22 @@ on:
- "**"
- "!**.md"


env:
DOTNET_VERSION: "9.0.x"

jobs:
unit-tests:
name: Unit Tests
runs-on: ubuntu-latest

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
Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion CodeGenerator/CodeGenerator.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<Nullable>enable</Nullable>
<RootNamespace>SqlcGenCsharp</RootNamespace>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion Drivers/Drivers.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<Nullable>enable</Nullable>
<RootNamespace>SqlcGenCsharp.Drivers</RootNamespace>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion EndToEndTests/EndToEndTests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<Nullable>enable</Nullable>
<RootNamespace>SqlcGenCsharpTests</RootNamespace>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion Extensions/Extensions.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<RootNamespace>SqlcGenCsharp</RootNamespace>
Expand Down
2 changes: 1 addition & 1 deletion GeneratedProtobuf/GeneratedProtobuf.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<Nullable>enable</Nullable>
<RootNamespace>SqlcGenCsharp</RootNamespace>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion LocalRunner/LocalRunner.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<PublishSingleFile>true</PublishSingleFile>
<RuntimeIdentifiers>osx-arm64;linux-x64</RuntimeIdentifiers>
<RootNamespace>SqlcGenCsharp</RootNamespace>
Expand Down
4 changes: 3 additions & 1 deletion PluginOptions/DotnetFramework.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ namespace SqlcGenCsharp;
public enum DotnetFramework
{
Dotnet80,
Dotnet90,
DotnetStandard20,
DotnetStandard21
}
Expand All @@ -15,6 +16,7 @@ public static class DotnetFrameworkExtensions
private static readonly Dictionary<DotnetFramework, string> EnumToString = new()
{
{ DotnetFramework.Dotnet80, "net8.0" },
{ DotnetFramework.Dotnet90, "net9.0" },
{ DotnetFramework.DotnetStandard21, "netstandard2.1" },
{ DotnetFramework.DotnetStandard20, "netstandard2.0" }
};
Expand All @@ -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;
}
}
2 changes: 1 addition & 1 deletion PluginOptions/PluginOptions.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<Nullable>enable</Nullable>
<RootNamespace>SqlcGenCsharp</RootNamespace>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion PluginOptions/RawOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion SqlcGenCsharp/SqlcGenCsharp.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<RootNamespace>SqlcGenCsharp</RootNamespace>
Expand Down
2 changes: 1 addition & 1 deletion SqlcGenCsharpTests/SqlcGenCsharpTests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

Expand Down
2 changes: 1 addition & 1 deletion WasmRunner/WasmRunner.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<RootNamespace>SqlcGenCsharp</RootNamespace>
<OutputType>Exe</OutputType>
<RuntimeIdentifier>wasi-wasm</RuntimeIdentifier>
Expand Down
2 changes: 1 addition & 1 deletion docs/ExamplesDocGen/ExampleDocGen.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<RootNamespace>DocsGenerator</RootNamespace>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<RootNamespace>MySqlConnectorDapperExampleGen</RootNamespace>
<OutputType>Library</OutputType>
<Nullable>enable</Nullable>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<RootNamespace>MySqlConnectorExampleGen</RootNamespace>
<OutputType>Library</OutputType>
<Nullable>enable</Nullable>
Expand Down
2 changes: 1 addition & 1 deletion examples/NpgsqlDapperExample/NpgsqlDapperExample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<RootNamespace>NpgsqlDapperExampleGen</RootNamespace>
<OutputType>Library</OutputType>
<Nullable>enable</Nullable>
Expand Down
2 changes: 1 addition & 1 deletion examples/NpgsqlExample/NpgsqlExample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<RootNamespace>NpgsqlExampleGen</RootNamespace>
<OutputType>Library</OutputType>
<Nullable>enable</Nullable>
Expand Down
2 changes: 1 addition & 1 deletion examples/SqliteDapperExample/SqliteDapperExample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<RootNamespace>SqliteDapperExampleGen</RootNamespace>
<OutputType>Library</OutputType>
<Nullable>enable</Nullable>
Expand Down
2 changes: 1 addition & 1 deletion examples/SqliteExample/SqliteExample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<RootNamespace>SqliteExampleGen</RootNamespace>
<OutputType>Library</OutputType>
<Nullable>enable</Nullable>
Expand Down
12 changes: 6 additions & 6 deletions sqlc.ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down Expand Up @@ -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"
Expand All @@ -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"
Expand Down Expand Up @@ -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"
Expand All @@ -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"
Expand Down
12 changes: 6 additions & 6 deletions sqlc.local.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down Expand Up @@ -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"
Expand All @@ -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"
Expand Down Expand Up @@ -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"
Expand All @@ -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"
Expand Down
Loading