Npgsql 3.2 is out and available on nuget.org. This is a major release with substantial internal changes and should be deployed with care. For critical applications it may be advisable to wait until 3.2.1 is out.
This release contains a large number of new features, but the main focus is performance - some usage scenarios may show dramatic improvements. See below for more details.
- Prepared statements are now persistent (survive beyond pooled connection close/open), providing significant performance improvements for applications with short-lived connections, such as most webapps (#483). Also, statements can optionally be prepared automatically by Npgsql based on use, unlocking prepared statement performance for O/RMs and data layers which don't prepare themselves, such as Dapper or Entity Framework Core (#1237). See this blog post for more info.
- Npgsql's custom logging has been replaced with [Microsoft.Extensions.Logging]((https://docs.microsoft.com/en-us/aspnet/core/fundamentals/logging), making it easy to log to most providers, and providing structured logging as well for providers such as Serilog (#1184).
- The internal I/O system has been overhauled to continue supporting sync and async I/O, but with a vastly better coding model. This should eliminate most protocol sync bugs, and make it much easier to maintain and write new type handlers (#1326).
- Kerberos login ("integrated security") is now support on Linux/Mac (#1079).
- Support for System.Transactions and distributed transactions has been rewritten, and should have fewer problems than before (#122).
- Performance counters have been implemented, similar to what SqlClient provides. See the documentation for more information (#619).
- The Visual Studio integration extension (DDEX) has been rewritten for a much better installation experience, and includes some new features as well (#1407). See the docs for more info.
- If you're application attempts to make use of more than one connection at the same time, an "operation already in progress" was thrown. This exception now provides more information to help you track down the bug (#1248).
Many other small changes have been made, especially with regards to performance. Here's the full list.
Breaking Changes from 3.1
- Connections can no longer be constructed with
NpgsqlConnectionStringBuilder- only plain string connection strings are supported (#1415).
- If you used Npgsql's logging, you will have to replace it with the new Microsoft.Extensions.Logging. See the docs.
Buffer Sizeconnection string parameter has been replaced by
Read Buffer Sizeand
Write Buffer Size.