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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/build-documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ jobs:
- name: Setup .NET Core
uses: actions/[email protected]
with:
dotnet-version: 10.0.x
dotnet-version: |
10.0.x
11.0.x

# docfx has issues specifically with analyzer/sourcegen projects; build manually before.
- name: Build Npgsql
Expand All @@ -55,7 +57,7 @@ jobs:
working-directory: EFCore.PG

- name: Get docfx
run: dotnet tool install --version 2.78.5 -g docfx
run: dotnet tool install --version 2.81.0 -g docfx

- name: Build docs
run: docfx --warningsAsErrors
Expand Down
2 changes: 1 addition & 1 deletion Npgsql
Submodule Npgsql updated 466 files
3 changes: 0 additions & 3 deletions conceptual/EFCore.PG/release-notes/11.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ Npgsql.EntityFrameworkCore.PostgreSQL version 11.0 is currently in development.

EF 11 complex types mapped with `ToJson()` now support indexing JSON members through the existing `HasIndex` APIs, including unique and composite indexes. By default, these create B-tree expression indexes over the selected values; explicit GIN indexes can target `jsonb` arrays and subdocuments. See [Indexing JSON columns](../mapping/json.md#indexing-json-columns) for examples and limitations.

> [!NOTE]
> The provider currently references EF `11.0.0-rc.2.26504.105`, which has two temporary limitations: C# migration scaffolding for JSON member indexes fails because it cannot scaffold a `RelationalJsonIndex` literal, and composite member indexes with mixed ascending/descending directions fail before SQL generation. Uniform ascending or descending composites can generate SQL, but remain affected by the scaffolding limitation. Both issues are fixed in [dotnet/efcore#39089](https://github.com/dotnet/efcore/pull/39089); the provider has not yet consumed those fixes.

## PostgreSQL JSON functions with ToJson

The existing PostgreSQL JSON functions, such as `EF.Functions.JsonContains()` and `EF.Functions.JsonExists()`, can now be used with complex types and owned entities mapped with `ToJson()`, including nested objects and collections:
Expand Down
2 changes: 1 addition & 1 deletion conceptual/Npgsql/dev/release-checklist.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ git push upstream :hotfix/9.0.2

## Update API documentation

[Our documentation site](https://www.npgsql.org) automatically publishes API docs for Npgsql and EFCore.PG from the `docs` branches in each of those two repos. After publishing a major version, you'll need to re-point that branch to the new version, so that API docs for that version are generated (`git reset --hard v9.0.0`). You'll then need to trigger a docs rebuild (you can just wait for the next time some small note needs to be updated etc.).
[Our documentation site](https://www.npgsql.org) generates API docs from the `Npgsql` and `EFCore.PG` submodules in the [documentation repository](https://github.com/npgsql/doc). After publishing a major version, check out the release tag in the corresponding submodule and commit the updated submodule pointer in the documentation repository. Update the SDK in the documentation build workflow or the target framework in `docfx.json` if the new version requires it. Merging the documentation changes to `main` triggers a rebuild and publishes the updated site.
2 changes: 1 addition & 1 deletion conceptual/Npgsql/diagnostics/logging.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ By default, Npgsql logs command executions at the `Information` log level, as we

## ASP.NET and dependency injection

If you're using ASP.NET, you can use the additional [Npgsql.DependencyInjection](https://www.nuget.org/packages/Npgsql.DependencyInjection) package, which provides seamless integration with dependency injection and logging:
If you're using ASP.NET, use `AddNpgsqlDataSource()` to integrate with dependency injection and logging. This method is included in Npgsql starting with version 11. For earlier versions, add a reference to [Npgsql.DependencyInjection](https://www.nuget.org/packages/Npgsql.DependencyInjection).

```csharp
var builder = WebApplication.CreateBuilder(args);
Expand Down
2 changes: 1 addition & 1 deletion conceptual/Npgsql/diagnostics/metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ dotnet counters monitor --counters Npgsql -p <PID>
db.client.connection.pool.name=CustomersDB,state=used 2
```

Note that Npgsql emits multiple *dimensions* with the metrics, e.g. the connection states (idle or used). In addition, an identifier for the connection pool - or data source - is emitted with every metric, allowing you to separately track e.g. multiple databases accessed in the same applications. By default, the `pool.name` will be the connection string, but it can be useful to give your data sources a name for easier and more consistent tracking:
Npgsql emits multiple *dimensions* with its metrics, such as the connection state (idle or used). The `db.client.connection.pool.name` tag identifies the data source so you can track multiple pools separately. Starting with Npgsql 11, this tag defaults to the connection string's `Application Name` if set; otherwise, it uses the connection string with the password removed. You can set an explicit name for consistent tracking:

```csharp
var builder = new NpgsqlDataSourceBuilder("Host=localhost;Username=test;Password=test")
Expand Down
3 changes: 0 additions & 3 deletions conceptual/Npgsql/release-notes/10.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@

Npgsql version 10.0 is out and available on [nuget.org](https://www.nuget.org/packages/Npgsql).

> [!NOTE]
> We're considering to start dropping support for synchronous APIs (`NpgsqlConnection.Open`, `NpgsqlCommand.ExecuteNonQuery`, etc.) starting with Npgsql 11.0. The current plan is to deprecate the API by throwing a runtime exception by default (with a switch to re-enable synchronous I/O) for Npgsql 11.0, while possibly completely removing it for Npgsql 12.0. This is in line with ASP.NET Core and .NET APIs in general, which are moving in the direction of async I/O only (for example, `System.IO.Pipelines` doesn't have synchronous I/O). If you have any questions or want to share you experience/issues with async I/O, please feel free to post in the [issue](https://github.com/npgsql/npgsql/issues/5865).

While this is a relatively minor release in terms of changes, it does contain new features and improvements. Notable changes:

## Tracing and metrics improvements
Expand Down
17 changes: 12 additions & 5 deletions conceptual/Npgsql/release-notes/11.0.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
# Npgsql 11.0 Release Notes

Npgsql version 11.0 is in development.
Npgsql 11.0.0 is available on [NuGet](https://www.nuget.org/packages/Npgsql/11.0.0).

> [!NOTE]
> We're considering to start dropping support for synchronous APIs (`NpgsqlConnection.Open`, `NpgsqlCommand.ExecuteNonQuery`, etc.) starting with Npgsql 11.0. The current plan is to deprecate the API by throwing a runtime exception by default (with a switch to re-enable synchronous I/O) for Npgsql 11.0, while possibly completely removing it for Npgsql 12.0. This is in line with ASP.NET Core and .NET APIs in general, which are moving in the direction of async I/O only (for example, `System.IO.Pipelines` doesn't have synchronous I/O). If you have any questions or want to share you experience/issues with async I/O, please feel free to post in the [issue](https://github.com/npgsql/npgsql/issues/5865).
See the [11.0.0 milestone](https://github.com/npgsql/npgsql/milestone/132?closed=1) for the full list of issues.

## Breaking changes

### Dependency injection is now part of Npgsql

The `Npgsql.DependencyInjection` package was merged into `Npgsql`. Remove the separate package reference when upgrading. Existing calls to `AddNpgsqlDataSource()` and related methods continue to work from the `Microsoft.Extensions.DependencyInjection` namespace, except for previously obsolete overloads, which have been removed. See [dependency injection setup](../diagnostics/logging.md#aspnet-and-dependency-injection) ([#6594](https://github.com/npgsql/npgsql/pull/6594)).

### Removed multiplexing

Previous versions of Npgsql supported a high-performance mode called "multiplexing". While this mode could increase throughput in certain extremely-high-performance scenarios, it did not scale in highly-concurrent situations with many CPU cores, and added quite a bit of complexity to the codebase. We'll evaluate re-introducing a similar implementation that's more scalable and better-designed.
The experimental multiplexing mode has been removed. It could increase throughput for some workloads but did not scale well with high concurrency on machines with many CPU cores. Remove `Multiplexing` and `Write Coalescing Buffer Threshold Bytes` from your connection strings, even if multiplexing was disabled, and remove any assignments to the corresponding connection string builder properties. Regular connection pooling is unchanged ([#6457](https://github.com/npgsql/npgsql/pull/6457)).

### Removed deprecated large object APIs

Npgsql 11.0 removes some APIs to support PostgreSQL [large objects](https://www.postgresql.org/docs/current/largeobjects.html); these were obsolete since Npgsql 8.0. The APIs were old and had some design issues, and were also not necessary, as the corresponding PostgreSQL functions can simply be called directly.
`NpgsqlLargeObjectManager` and `NpgsqlLargeObjectStream`, obsolete since Npgsql 8.0, have been removed. Use PostgreSQL's [large object functions](https://www.postgresql.org/docs/current/lo-funcs.html) directly. For example, `lo_get` and `lo_put` read and write byte ranges. If you use `lo_open` to obtain a descriptor, use it on the same connection and within the same transaction. Existing large objects do not need to be migrated ([#6493](https://github.com/npgsql/npgsql/pull/6493)).

### Application Name can change pool metric labels

If you set `Application Name` in your connection string without explicitly naming the data source, Npgsql 11 uses that application name rather than the connection string as the `db.client.connection.pool.name` metric tag. Update dashboards that filter on the old label, or set `NpgsqlDataSourceBuilder.Name` explicitly to control the label and distinguish pools with the same application name. See [metrics](../diagnostics/metrics.md) ([#6533](https://github.com/npgsql/npgsql/pull/6533)).
3 changes: 0 additions & 3 deletions conceptual/Npgsql/release-notes/9.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@

Npgsql version 9.0 is out and available on [nuget.org](https://www.nuget.org/packages/Npgsql).

> [!NOTE]
> We're considering to start dropping support for synchronous APIs (`NpgsqlConnection.Open`, `NpgsqlCommand.ExecuteNonQuery`, etc.) starting with Npgsql 10.0. The current plan is to deprecate the API by throwing a runtime exception by default (with a switch to re-enable synchronous I/O) for Npgsql 10.0, while possibly completely removing it for Npgsql 11.0. This is in line with ASP.NET Core and .NET runtime in general, which are moving in the direction of async I/O only (for example, `System.IO.Pipelines` doesn't have synchronous I/O). If you have any questions or want to share you experience/issues with async I/O, please feel free to post in the [issue](https://github.com/npgsql/npgsql/issues/5865).

## Tracing improvements

Several quality-of-life improvements have been implemented for Npgsql's OpenTelemetry tracing support. You can now do the following via the new <xref:Npgsql.NpgsqlDataSourceBuilder.ConfigureTracing*?displayProperty=nameWithType> API:
Expand Down
2 changes: 2 additions & 0 deletions conceptual/Npgsql/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
href: index.md
- name: Release notes
items:
- name: "11.0"
href: release-notes/11.0.md
- name: "10.0"
href: release-notes/10.0.md
- name: "9.0"
Expand Down
1 change: 1 addition & 0 deletions docfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
}
],
"dest": "obj/api/Npgsql",
"filter": "npgsql-api-filter.yml",
"properties":
{
"TargetFramework": "net10.0"
Expand Down
5 changes: 5 additions & 0 deletions npgsql-api-filter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiRules:
# EFCore.PG already publishes a different type with this exact UID.
- exclude:
uidRegex: ^Microsoft\.Extensions\.DependencyInjection\.NpgsqlServiceCollectionExtensions$
type: Class