Releases: vapor/postgres-nio
PostgresNIO 1.20.0
SemVer Minor
- Support additional connection parameters (#361)
SPI(ConnectionPool) changes
- Add test cancel connection request (#439)
- Add tests to lease multiple connections at once (#440)
- Add test to lease connection after shutdown has started (#441)
- Add support for multiple streams (#442)
- Fix crash in PoolStateMachine+ConnectionGroup when closing connection while keepAlive is running (#444, patch credit to @lovetodream)
PostgresNIO 1.19.1
PostgresNIO 1.19.0
What is better than one PostgresConnection? Multiple PostgresConnections! This is why PostgresNIO now features an experimental
PostgresClient that is backed by a new ConnectionPool implementation.
The new PostgresClient and its underlying ConnectionPool implementation are large new features that are in an early experimental stage. We encourage PostgresNIO users to try them and provide feedback. The implementation is so new, and the feature scope so large, that we don't make any API stability promises for PostgresClient yet; it is therefore exposed as an SPI import.
If you want to start playing with the new PostgresClient, start with a pattern like this:
@_spi(ConnectionPool) import PostgresNIO
let client = PostgresClient(configuration: configuration, logger: logger)
await withTaskGroup(of: Void.self) {
taskGroup.addTask {
// 🚨 The PostgresClient only works if its `run()` method is executed in a long-running task.
// This ensures that all background work shall be executed in a way that plays
// nicely with structured concurrency.
client.run()
}
taskGroup.addTask {
client.withConnection { connection in
do {
let rows = try await connection.query("SELECT userID, name, age FROM users;")
for try await (userID, name, age) in rows.decode((UUID, String, Int).self) {
// do something with the values
}
} catch {
// handle errors
}
}
}
}We are currently working with the ServiceLifecycle maintainers to enable simple integration (however, we do not intend to depend on ServiceLifecycle directly).
If you run into any problems, please open a new Issue.
SPI(ConnectionPool) changes
- Add new
ConnectionPoolModule,PostgresClient(#412, #416, #417, #418, #419, #420, #421, #422, #424, #425, #426, #427, #428, #429, #430)
SemVer Minor
- Fix
PostgresDecodableinference forRawRepresentableenums (#423, patch credit to @MahdiBM) - Remove warn-concurrency warnings (#408)
- Update minimum Swift requirement to 5.7 (#414)
Other Changes
- Update SSWG Graduation Level (#409)
PostgresNIO 1.18.1
PostgresNIO 1.18.0
🚀 This PostgresNIO release adds a number of changes that allow users to fully embrace structured concurrency:
- Prepared statement async/await support
- Notification listen async/await support
- Users don't need to provide EventLoops when creating a connection
🚨 This release changes the behavior of PostgresConnection.close(). Before this release a call to close() triggered a graceful shutdown of the connection. This means that all previously enqueued queries got executed before the connection was closed. Starting with 1.18.0 close() leads to a direct connection closure cancelling the running and all queued queries. This change is necessary to get rid of connections to servers where the server stopped responding. The previous behavior can be achieved using the new closeGracefully() function on PostgresConnection.
SemVer Minor
- Add async listen; Refactor all listen code (#264, #392)
- Add
PostgresDynamicTypeThrowingEncodableandPostgresDynamicTypeEncodable(#365, patch credit to @marius-se) - Use
EventLoopprovided by SwiftNIO'sMultiThreadedEventLoopGroup.singleton(#389, patch credit to @tkrajacic) async/awaitprepared statement API (#390, patch credit to @mariosangiorgio)close()closes immediately; Add newcloseGracefully()(#383, #397, #400)
SemVer Patch
- Use variadic generics in Swift 5.9 (#341)
- Crash fix: Multiple bad messages could trigger reentrancy issue (#379)
- Move
PostgresFrontendMessageto tests (#381, #395, #399) PostgresBackendMessage.IDshould be backed by UInt8 directly (#386)- Remove
PrepareStatementStateMachine(#391) - Fix a few inaccurate or confusing precondition failure messages (#398)
Other Changes
PostgresNIO 1.17.0
SemVer Minor
- Ensure
PostgresConnection.Configuration.TLSis concurrency safe by making propertydisablecomputed (#376, patch credit to @sidepelican)
New Contributors
- @sidepelican made their first contribution in #376
PostgresNIO 1.16.0
Semver Minor
Full Changelog: 1.15.0...1.16.0
PostgresNIO 1.15.0
SemVer Minor
- Make PostgresCodable typealias public (#363)
- Add support for int4range, int8range, int4range[], int8range[] (#330 by @rausnitz)
SemVer Patch
Other Changes
- Various cleanups to CI (#359, #362, #369)
- Add
testSelectActiveConnectiontest (#364) - Add Postgres 15 to docker compose (#366 by @marius-se)
New Contributors
- @marius-se made their first contribution in #366
Full Changelog: 1.14.2...1.15.0
PostgresNIO 1.14.2
Address CVE-2023-31136 - PostgresNIO processes unencrypted bytes from man-in-the-middle. See the CVE-2023-31136 security advisory for details.
Thanks to PostgreSQL's Tom Lane <tgl@sss.pgh.pa.us> for reporting this issue!