Skip to content
Merged
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ updates:
# and because it submits 3 different PRs
- dependency-name: "Microsoft.EntityFrameworkCore.*"
- dependency-name: "Microsoft.Extensions.*"
- dependency-name: "Npgsql"
- dependency-name: "HuaweiCloud.Driver.GaussDB"
schedule:
interval: daily

Expand Down
60 changes: 41 additions & 19 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,48 +60,70 @@ jobs:
run: dotnet build --configuration Debug
shell: bash

- name: Start PostgreSQL ${{ matrix.pg_major }} (Linux)
- name: Start GaussDB ${{ matrix.pg_major }} (Linux)
if: startsWith(matrix.os, 'ubuntu')
run: |
# First uninstall any PostgreSQL installed on the image
dpkg-query -W --showformat='${Package}\n' 'postgresql-*' | xargs sudo dpkg -P postgresql
# First uninstall any GaussDB installed on the image
dpkg-query -W --showformat='${Package}\n' 'opengauss-*' | xargs sudo dpkg -P opengauss

# Automated repository configuration
sudo apt install -y postgresql-common
sudo /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -v ${{ matrix.pg_major }} -y
sudo apt install -y opengauss-common
sudo /usr/share/opengauss-common/pgdg/apt.opengauss.org.sh -v ${{ matrix.pg_major }} -y
sudo apt-get update -qq
sudo apt-get install -qq postgresql-${{ matrix.pg_major }}
sudo apt-get install -qq opengauss-${{ matrix.pg_major }}

# To disable PostGIS for prereleases (because it usually isn't available until late), surround with the following:
#if [ -z "${{ matrix.pg_prerelease }}" ]; then
sudo apt-get install -qq postgresql-${{ matrix.pg_major }}-postgis-${{ env.postgis_version }}
sudo apt-get install -qq opengauss-${{ matrix.pg_major }}-postgis-${{ env.postgis_version }}
#fi

sudo sed -i 's/max_connections = 100/max_connections = 200/g' /etc/postgresql/${{ matrix.pg_major }}/main/postgresql.conf
sudo systemctl restart postgresql
sudo sed -i 's/max_connections = 100/max_connections = 200/g' /etc/opengauss/${{ matrix.pg_major }}/main/opengauss.conf
sudo systemctl restart opengauss
sudo -u postgres psql -c "CREATE USER npgsql_tests SUPERUSER PASSWORD 'npgsql_tests'"

- name: Start PostgreSQL ${{ matrix.pg_major }} (Windows)
- name: Start GaussDB ${{ matrix.pg_major }} (Windows)
if: startsWith(matrix.os, 'windows')
run: |
# Find EnterpriseDB version number
EDB_VERSION=$(pwsh -c "
\$global:progressPreference='silentlyContinue';
Invoke-WebRequest -URI https://www.postgresql.org/applications-v2.xml |
Invoke-WebRequest -URI https://www.opengauss.org/applications-v2.xml |
Select-Object -ExpandProperty Content |
Select-Xml -XPath '/applications/application[id=\"postgresql_${{ matrix.pg_major }}\" and platform=\"windows-x64\"]/version/text()' |
Select-Xml -XPath '/applications/application[id=\"opengauss_${{ matrix.pg_major }}\" and platform=\"windows-x64\"]/version/text()' |
Select-Object -First 1 -ExpandProperty Node |
Select-Object -ExpandProperty Value")

# Install PostgreSQL
echo "Installing PostgreSQL (version: ${EDB_VERSION})"
curl -o pgsql.zip -L https://get.enterprisedb.com/postgresql/postgresql-${EDB_VERSION}-windows-x64-binaries.zip
# Install GaussDB
echo "Installing GaussDB (version: ${EDB_VERSION})"
curl -o pgsql.zip -L https://get.enterprisedb.com/opengauss/opengauss-${EDB_VERSION}-windows-x64-binaries.zip
unzip pgsql.zip -x 'pgsql/include/**' 'pgsql/doc/**' 'pgsql/pgAdmin 4/**' 'pgsql/StackBuilder/**'

# Match Npgsql CI Docker image and stash one level up
# Match GaussDB CI Docker image and stash one level up
cp $GITHUB_WORKSPACE/.build/{server.crt,server.key} pgsql

# Start PostgreSQL
# Find OSGEO version number
OSGEO_VERSION=$(\
curl -Ls https://download.osgeo.org/postgis/windows/pg${{ matrix.pg_major }} |
sed -n 's/.*>postgis-bundle-pg${{ matrix.pg_major }}-\(${{ env.postgis_version }}.[0-9]*.[0-9]*\)x64.zip<.*/\1/p' |
tail -n 1)
if [ -z "$OSGEO_VERSION" ]; then
OSGEO_VERSION=$(\
curl -Ls https://download.osgeo.org/postgis/windows/pg${{ matrix.pg_major }}/archive |
sed -n 's/.*>postgis-bundle-pg${{ matrix.pg_major }}-\(${{ env.postgis_version }}.[0-9]*.[0-9]*\)x64.zip<.*/\1/p' |
tail -n 1)
POSTGIS_PATH="archive/"
else
POSTGIS_PATH=""
fi

# Install PostGIS
echo "Installing PostGIS (version: ${OSGEO_VERSION})"
POSTGIS_FILE="postgis-bundle-pg${{ matrix.pg_major }}-${OSGEO_VERSION}x64"
curl -o postgis.zip -L https://download.osgeo.org/postgis/windows/pg${{ matrix.pg_major }}/${POSTGIS_FILE}.zip
unzip postgis.zip -d postgis
cp -a postgis/$POSTGIS_FILE/. pgsql/

# Start GaussDB
pgsql/bin/initdb -D pgsql/PGDATA -E UTF8 -U postgres
pgsql/bin/pg_ctl -D pgsql/PGDATA -l logfile -o '-c max_connections=200 -c max_prepared_transactions=10 -c ssl=true -c ssl_cert_file=../server.crt -c ssl_key_file=../server.key' start

Expand Down Expand Up @@ -146,7 +168,7 @@ jobs:
- name: Upload artifacts
uses: actions/upload-artifact@v6
with:
name: EFCore.PG.CI
name: EFCore.GaussDB.CI
path: nupkgs

- name: Publish packages to MyGet (vnext)
Expand Down Expand Up @@ -178,7 +200,7 @@ jobs:
- name: Upload artifacts
uses: actions/upload-artifact@v6
with:
name: EFCore.PG.Release
name: EFCore.GaussDB.Release
path: nupkgs

# TODO: Create a release
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ artifacts/
TestResult.xml
.dotnet
.vscode/
example/GetStarted/GetStarted/.env
21 changes: 11 additions & 10 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
<Project>
<PropertyGroup>
<VersionPrefix>11.0.0-preview.1</VersionPrefix>
<TargetFramework>net10.0</TargetFramework>
<VersionPrefix>0.0.1</VersionPrefix>
<TargetFrameworks>net10.0</TargetFrameworks>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<AnalysisLevel>latest</AnalysisLevel>
<NoWarn>$(NoWarn);NU5105</NoWarn> <!-- The package version '1.2.3+semver2.metadata' uses SemVer 2.0.0 or components of SemVer 1.0.0 that are not supported on legacy clients. -->
<SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage>
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)Npgsql.snk</AssemblyOriginatorKeyFile>
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)GaussDB.snk</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<ImplicitUsings>true</ImplicitUsings>
<GenerateDocumentationFile>true</GenerateDocumentationFile>

<Copyright>Copyright 2025 © The Npgsql Development Team</Copyright>
<Company>Npgsql</Company>
<Copyright>Copyright 2026 © The GaussDB Development Team</Copyright>
<Company>GaussDB</Company>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<PackageLicenseExpression>PostgreSQL</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/npgsql/efcore.pg</PackageProjectUrl>
<PackageIcon>postgresql.png</PackageIcon>
<PackageProjectUrl>https://github.com/HuaweiCloudDeveloper/gaussdb-efcore</PackageProjectUrl>
<PackageIcon>gaussdb.png</PackageIcon>
</PropertyGroup>

<ItemGroup>
<None Include="$(MSBuildThisFileDirectory)postgresql.png" Pack="true" PackagePath="" />
<None Include="$(MSBuildThisFileDirectory)gaussdb.png" Pack="true" PackagePath="" />
</ItemGroup>

<ItemGroup>
Expand Down Expand Up @@ -51,8 +52,8 @@
<Using Include="Microsoft.EntityFrameworkCore.Utilities" />
<Using Include="Microsoft.Extensions.Logging" />
<Using Include="Microsoft.Extensions.DependencyInjection" />
<Using Include="Npgsql" />
<Using Include="NpgsqlTypes" />
<Using Include="HuaweiCloud.GaussDB" />
<Using Include="HuaweiCloud.GaussDBTypes" />
</ItemGroup>

</Project>
34 changes: 14 additions & 20 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -1,30 +1,24 @@
<Project>
<Project>
<PropertyGroup>
<EFCoreVersion>10.0.0</EFCoreVersion>
<MicrosoftExtensionsVersion>10.0.0</MicrosoftExtensionsVersion>
<NpgsqlVersion>10.0.0</NpgsqlVersion>
<DriverVersion>0.1.0</DriverVersion>
</PropertyGroup>

<ItemGroup>
<!--
Dependencies on EF preview versions should be locked to a specific version (as provider-facing breaking changes are frequent).
For released versions, depend on anything in the current major version to allow users to update to higher patch versions.
-->
<PackageVersion Include="Microsoft.EntityFrameworkCore" Version="[10.0.0]" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Relational" Version="[10.0.0]" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Abstractions" Version="[10.0.0]" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Relational.Specification.Tests" Version="[10.0.0]" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Design" Version="[10.0.0]" />

<PackageVersion Include="dotenv.net" Version="4.0.0" />
<PackageVersion Include="HuaweiCloud.EntityFrameworkCore.GaussDB" Version="0.0.1-preview.260105" />
<PackageVersion Include="Microsoft.EntityFrameworkCore" Version="$(EFCoreVersion)" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Relational" Version="$(EFCoreVersion)" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Abstractions" Version="$(EFCoreVersion)" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Relational.Specification.Tests" Version="$(EFCoreVersion)" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Design" Version="$(EFCoreVersion)" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Json" Version="$(MicrosoftExtensionsVersion)" />
<PackageVersion Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="$(MicrosoftExtensionsVersion)" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="$(MicrosoftExtensionsVersion)" />

<PackageVersion Include="Npgsql" Version="$(NpgsqlVersion)" />
<PackageVersion Include="Npgsql.NodaTime" Version="$(NpgsqlVersion)" />
<PackageVersion Include="Npgsql.NetTopologySuite" Version="$(NpgsqlVersion)" />
<PackageVersion Include="Npgsql.DependencyInjection" Version="$(NpgsqlVersion)" />

<PackageVersion Include="HuaweiCloud.Driver.GaussDB" Version="$(DriverVersion)" />
<PackageVersion Include="HuaweiCloud.Driver.GaussDB.NodaTime" Version="$(DriverVersion)" />
<PackageVersion Include="HuaweiCloud.Driver.GaussDB.DependencyInjection" Version="$(DriverVersion)" />
<PackageVersion Include="HuaweiCloud.Driver.GaussDB.NetTopologySuite" Version="$(DriverVersion)" />
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="8.0.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
<PackageVersion Include="xunit" Version="2.9.3" />
Expand All @@ -33,4 +27,4 @@
<PackageVersion Include="xunit.runner.visualstudio" Version="3.1.5" />
<PackageVersion Include="GitHubActionsTestLogger" Version="2.4.1" />
</ItemGroup>
</Project>
</Project>
28 changes: 28 additions & 0 deletions EFCore.GaussDB.slnx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<Solution>
<Folder Name="/Solution Items/">
<File Path=".editorconfig" />
<File Path="Directory.Build.props" />
<File Path="Directory.Packages.props" />
<File Path="GaussDB.snk" />
<File Path="global.json" />
<File Path="NuGet.config" />
<File Path="README.md" />
</Folder>
<Folder Name="/example/">
<Project Path="example/GetStarted/GetStarted/GetStarted.csproj" Id="4a953120-fcc5-4b5d-90a5-9d1251a86725" />
</Folder>
<Folder Name="/Github/">
<File Path=".github/dependabot.yml" />
<File Path=".github/workflows/build.yml" />
<File Path=".github/workflows/codeql-analysis.yml" />
</Folder>
<Folder Name="/src/">
<Project Path="src/EFCore.GaussDB.NodaTime/EFCore.GaussDB.NodaTime.csproj" />
<Project Path="src/EFCore.GaussDB.NTS/EFCore.GaussDB.NTS.csproj" />
<Project Path="src/EFCore.GaussDB/EFCore.GaussDB.csproj" />
</Folder>
<Folder Name="/test/">
<Project Path="test/EFCore.GaussDB.FunctionalTests/EFCore.GaussDB.FunctionalTests.csproj" />
<Project Path="test/EFCore.GaussDB.Tests/EFCore.GaussDB.Tests.csproj" />
</Folder>
</Solution>
File renamed without changes.
25 changes: 0 additions & 25 deletions EFCore.PG.slnx

This file was deleted.

File renamed without changes.
18 changes: 9 additions & 9 deletions NuGet.config
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="dotnet10" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet10/nuget/v3/index.json" />
<add key="dotnet-eng" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json" />
<add key="npgsql-vnext" value="https://www.myget.org/F/npgsql-vnext/api/v3/index.json" />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
<add key="dotnet10" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet10/nuget/v3/index.json" allowInsecureConnections="True" />
<add key="dotnet-eng" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json" allowInsecureConnections="True" />
<add key="npgsql-vnext" value="https://www.myget.org/F/npgsql-vnext/api/v3/index.json" allowInsecureConnections="True" />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" allowInsecureConnections="True" />
</packageSources>

<packageSourceMapping>
<packageSource key="nuget.org">
<package pattern="*" />
<!-- Our npgsql-vnext feed doesn't necessarily contain the last preview (package retention rules...), so we take it from nuget.org -->
<package pattern="Npgsql" />
<package pattern="Npgsql.*" />
<package pattern="HuaweiCloud.GaussDB" />
<package pattern="HuaweiCloud.GaussDB.*" />
</packageSource>
<packageSource key="npgsql-vnext">
<package pattern="Npgsql" />
<package pattern="Npgsql.*" />
<package pattern="HuaweiCloud.GaussDB" />
<package pattern="HuaweiCloud.GaussDB.*" />
</packageSource>
<packageSource key="dotnet10">
<package pattern="*" />
Expand Down
Loading
Loading