From 5d9cc6b9c149bf51d679c867a6e88bd87e6596a4 Mon Sep 17 00:00:00 2001 From: Nikita Kazmin Date: Mon, 28 Oct 2024 12:57:48 +0300 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Shay Rojansky --- conceptual/Npgsql/release-notes/9.0.md | 14 +++++++------- conceptual/Npgsql/security.md | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/conceptual/Npgsql/release-notes/9.0.md b/conceptual/Npgsql/release-notes/9.0.md index 098694be..fb9f74b5 100644 --- a/conceptual/Npgsql/release-notes/9.0.md +++ b/conceptual/Npgsql/release-notes/9.0.md @@ -3,7 +3,7 @@ Npgsql version 9.0 will be released together with .NET 9 and will be available on nuget. The full list of issues for this release is [available here](https://github.com/npgsql/npgsql/milestone/109?closed=1). > [!NOTE] -> We're considering to start dropping support for synchronous API (`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 completely removing it for Npgsql 11.0. This is in line with ASP.NET Core and .NET runtime in general, which move 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). +> We're considering to start dropping support for synchronous API (`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 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). ## Add support for interval's infinity values via NodaTime's Period.MinValue/Period.MaxValue @@ -11,11 +11,11 @@ PostgreSQL 17 added support for infinity values with `interval` type. In turn, N ## Add support for cidr <-> IPNetwork mapping -.NET 8 added a new type [IPNetwork](https://learn.microsoft.com/en-us/dotnet/api/system.net.ipnetwork?view=net-8.0) which represents an IP network with an [IPAddress](https://learn.microsoft.com/en-us/dotnet/api/system.net.ipaddress?view=net-8.0) containing the network prefix and an `int` defining the prefix length. This type seems to be a perfect fit for PostgreSQL's `cidr` type, which is why we added support to read and write it. See [this](https://github.com/npgsql/npgsql/issues/5821) issue for more info. +.NET 8 added a new type [IPNetwork](https://learn.microsoft.com/en-us/dotnet/api/system.net.ipnetwork?view=net-8.0) which represents an IP network with an [IPAddress](https://learn.microsoft.com/en-us/dotnet/api/system.net.ipaddress?view=net-8.0) containing the network prefix and an `int` defining the prefix length. This type seems to be a perfect fit for PostgreSQL's `cidr` type, which is why we added support to read and write it. The default when reading a `cidr` is still NpgsqlCidr in 9.0, though this will likely change in Npgsql 10.0. See [this](https://github.com/npgsql/npgsql/issues/5821) issue for more info. ## Add support for direct SSL -PostgreSQL 17 added support for direct SSL. Direct SSL allows clients to skip sending SSL support request, which saves a roundtrip while opening a physical connection. This behavior is disabled by default (as it's not supported with previous versions of PostgreSQL), but you can enable it via `SslNegotiation` property in connection string or environment variable `PGSSLNEGOTIATION`. See [this](https://github.com/npgsql/npgsql/issues/5677) issue for more info. +PostgreSQL 17 added support for direct SSL. Direct SSL allows clients to skip sending an SSL support request, which saves a roundtrip while opening a physical connection. This behavior is disabled by default (as it's not supported with previous versions of PostgreSQL), but you can enable it via `SslNegotiation` property in connection string or environment variable `PGSSLNEGOTIATION`. See [this](https://github.com/npgsql/npgsql/issues/5677) issue for more info. ## Add support to modify SslClientAuthenticationOptions @@ -37,16 +37,16 @@ This change allows clients to receive the name of changed column while reading r ### .NET Standard 2.0 (and .NET Framework) is not supported -Starting with Npgsql 9.0 we're dropping support for .NET Standard 2.0, and in turn .NET Framework. Npgsql is a constantly evolving driver, which makes it problematic to add new features (like `NegotiateOptionsCallback` which allows to change [NegotiateAuthenticationClientOptions](https://learn.microsoft.com/en-us/dotnet/api/system.net.security.negotiateauthenticationclientoptions?view=net-8.0)) which use API that does not exist on older versions of .NET. This doesn't mean you can't use Npgsql with .NET Standard 2.0 as we're still commited to support Npgsql 8.0 (which does support .NET Standard 2.0) up until .NET 8 is out of support. See [this](https://github.com/npgsql/npgsql/issues/5296) issue for more info. +Npgsql 9.0 drops support for .NET Standard 2.0, and in turn .NET Framework. Npgsql is a constantly evolving driver, which makes it problematic to add new features which use APIs that do not exist on older versions of .NET. This doesn't mean you can't use Npgsql with .NET Standard 2.0: we're still committed to supporting Npgsql 8.0 (which does support .NET Standard 2.0). See [this](https://github.com/npgsql/npgsql/issues/5296) issue for more info. ### Change some PgOutputReplicationOptions properties to support logical streaming replication protocol V4 -The main changes are in `PgOutputReplicationOptions` class, where `ProtocolVersion` and `StreamingMode` properties were changed to an enum. See [this](https://github.com/npgsql/npgsql/issues/5760) issue for more info. +The main changes are in the `PgOutputReplicationOptions` class, where `ProtocolVersion` and `StreamingMode` properties were changed to an enum. See [this](https://github.com/npgsql/npgsql/issues/5760) issue for more info. ### Multiple ssl related callbacks on NpgsqlDataSourceBuilder are deprecated in favor of UseSslClientAuthenticationOptionsCallback -With a new callback `UseSslClientAuthenticationOptionsCallback` users have much more control over the way Npgsql connects to PostgreSQL via `SslStream`. This makes other callbacks, like `UseUserCertificateValidationCallback` and `UseClientCertificate`, offer subpar experience, which is why we deprecate them. See [this](https://github.com/npgsql/npgsql/issues/5478) issue for more info. +With the new `UseSslClientAuthenticationOptionsCallback` callback, users have much more control over the way Npgsql connects to PostgreSQL via `SslStream`. This makes other callbacks, like `UseUserCertificateValidationCallback` and `UseClientCertificate` less useful, which is why we're obsoleting them. See [this](https://github.com/npgsql/npgsql/issues/5478) issue for more info. ### The default value of ConnectionLifetime property in connection string is set to 1 hour -Previously, the default value of this property was set to 0, which made connections to last indefinitely. The old behavior was problematic because each physical connection on PostgreSQL's side has holds on certain caches, which can only grow over time. See [this](https://github.com/npgsql/npgsql/pull/5662) pull request for more info. +Previously, the default value of this property was set to 0, which made connections last indefinitely. The old behavior was problematic because each physical connection on PostgreSQL's side has holds on certain caches, which can only grow over time. See [this](https://github.com/npgsql/npgsql/pull/5662) pull request for more info. diff --git a/conceptual/Npgsql/security.md b/conceptual/Npgsql/security.md index d06e62ed..6a462ff6 100644 --- a/conceptual/Npgsql/security.md +++ b/conceptual/Npgsql/security.md @@ -76,7 +76,7 @@ To disable certificate validation when using `Require`, set `Trust Server Certif ### SSL Negotiation -Starting Npgsql 9.0 you control how SSL encryption is negotiated while connecting to PostgreSQL via the `SSL Negotiation` connection string parameter or via the `PGSSLNEGOTIATION` environment variable. In the default `postgres` mode, the client first asks the server if SSL is supported. In `direct` mode, the client starts the standard SSL handshake directly after establishing the TCP/IP connection. +Starting with Npgsql 9.0, you can control how SSL encryption is negotiated while connecting to PostgreSQL via the `SSL Negotiation` connection string parameter, or via the `PGSSLNEGOTIATION` environment variable. In the default `postgres` mode, the client first asks the server if SSL is supported. In `direct` mode, the client starts the standard SSL handshake directly after establishing the TCP/IP connection. Enabling this option (by changing it to `direct` mode) can improve latency while opening a physical connection by removing one round trip.