Update client libs for test_runner/pg_clients to their latest versions (#4092)

Also, use Workaround D for `swift/PostgresClientKitExample`, 
which supports neither SNI nor connections options
This commit is contained in:
Alexander Bayandin
2023-05-04 18:22:04 +01:00
committed by GitHub
parent 88f39c11d4
commit 291b4f0d41
21 changed files with 375 additions and 211 deletions

View File

@@ -1,10 +1,10 @@
FROM swift:5.7 AS build
FROM swift:5.8 AS build
WORKDIR /source
COPY . .
RUN swift build --configuration release
FROM swift:5.7
FROM swift:5.8
WORKDIR /app
COPY --from=build /source/.build/release .
CMD ["/app/PostgresNIOExample"]

View File

@@ -5,8 +5,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/vapor/postgres-nio.git",
"state" : {
"revision" : "7daf026e145de2c07d6e37f4171b1acb4b5f22b1",
"version" : "1.12.1"
"revision" : "dbf9c2eb596df39cba8ff3f74d74b2e6a31bd937",
"version" : "1.14.1"
}
},
{
@@ -14,8 +14,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-atomics.git",
"state" : {
"revision" : "ff3d2212b6b093db7f177d0855adbc4ef9c5f036",
"version" : "1.0.3"
"revision" : "6c89474e62719ddcc1e9614989fff2f68208fe10",
"version" : "1.1.0"
}
},
{
@@ -59,8 +59,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-nio.git",
"state" : {
"revision" : "45167b8006448c79dda4b7bd604e07a034c15c49",
"version" : "2.48.0"
"revision" : "d1690f85419fdac8d54e350fb6d2ab9fd95afd75",
"version" : "2.51.1"
}
},
{
@@ -68,8 +68,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-nio-ssl.git",
"state" : {
"revision" : "4fb7ead803e38949eb1d6fabb849206a72c580f3",
"version" : "2.23.0"
"revision" : "e866a626e105042a6a72a870c88b4c531ba05f83",
"version" : "2.24.0"
}
},
{
@@ -77,8 +77,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-nio-transport-services.git",
"state" : {
"revision" : "c0d9a144cfaec8d3d596aadde3039286a266c15c",
"version" : "1.15.0"
"revision" : "41f4098903878418537020075a4d8a6e20a0b182",
"version" : "1.17.0"
}
}
],

View File

@@ -1,10 +1,10 @@
// swift-tools-version:5.7
// swift-tools-version:5.8
import PackageDescription
let package = Package(
name: "PostgresNIOExample",
dependencies: [
.package(url: "https://github.com/vapor/postgres-nio.git", from: "1.8.0")
.package(url: "https://github.com/vapor/postgres-nio.git", from: "1.14.1")
],
targets: [
.executableTarget(

View File

@@ -14,15 +14,11 @@ await Task {
let sslContext = try! NIOSSLContext(configuration: .makeClientConfiguration())
let config = PostgresConnection.Configuration(
connection: .init(
host: env["NEON_HOST"] ?? "",
port: 5432
),
authentication: .init(
username: env["NEON_USER"] ?? "",
database: env["NEON_DATABASE"] ?? "",
password: env["NEON_PASSWORD"] ?? ""
),
host: env["NEON_HOST"] ?? "",
port: 5432,
username: env["NEON_USER"] ?? "",
password: env["NEON_PASSWORD"] ?? "",
database: env["NEON_DATABASE"] ?? "",
tls: .require(sslContext)
)
@@ -42,7 +38,7 @@ await Task {
try await connection.close()
// Shutdown the EventLoopGroup, once all connections are closed.
try eventLoopGroup.syncShutdownGracefully()
try await eventLoopGroup.shutdownGracefully()
} catch {
print(error)
}