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
7 changes: 3 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,14 @@ jobs:
strategy:
fail-fast: false
matrix:
dbimage: ['postgres:15', 'postgres:14', 'postgres:11']
dbimage: ['postgres:15', 'postgres:13', 'postgres:11']
swiftver: [
'swift:5.4-focal', 'swift:5.5-focal', 'swift:5.6-focal',
'swift:5.7-jammy',
'swift:5.5-bionic', 'swift:5.6-focal', 'swift:5.7-jammy',
'swiftlang/swift:nightly-main-jammy'
]
include: [
{dbimage: 'postgres:15', dbauth: 'scram-sha-256'},
{dbimage: 'postgres:14', dbauth: 'md5'},
{dbimage: 'postgres:13', dbauth: 'md5'},
{dbimage: 'postgres:11', dbauth: 'trust'}
]
container: ${{ matrix.swiftver }}
Expand Down
8 changes: 4 additions & 4 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.4
// swift-tools-version:5.5
import PackageDescription

let package = Package(
Expand All @@ -10,9 +10,9 @@ let package = Package(
.library(name: "FluentPostgresDriver", targets: ["FluentPostgresDriver"]),
],
dependencies: [
.package(url: "https://github.com/vapor/async-kit.git", from: "1.2.0"),
.package(url: "https://github.com/vapor/fluent-kit.git", from: "1.31.0"),
.package(url: "https://github.com/vapor/postgres-kit.git", from: "2.5.1"),
.package(url: "https://github.com/vapor/async-kit.git", from: "1.14.0"),
.package(url: "https://github.com/vapor/fluent-kit.git", from: "1.36.0"),
.package(url: "https://github.com/vapor/postgres-kit.git", from: "2.9.0"),
],
targets: [
.target(name: "FluentPostgresDriver", dependencies: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ final class FluentPostgresDriverTests: XCTestCase {
let db = self.dbs.database(
.iso8601,
logger: .init(label: "test"),
on: self.eventLoopGroup.next()
on: self.eventLoopGroup.any()
)!

let date = Date()
Expand Down Expand Up @@ -200,11 +200,11 @@ final class FluentPostgresDriverTests: XCTestCase {
self.dbs.use(.testPostgres(subconfig: "A"), as: .a)
self.dbs.use(.testPostgres(subconfig: "B"), as: .b)

let a = self.dbs.database(.a, logger: Logger(label: "test.fluent.a"), on: self.eventLoopGroup.next())
let a = self.dbs.database(.a, logger: Logger(label: "test.fluent.a"), on: self.eventLoopGroup.any())
_ = try (a as! PostgresDatabase).query("drop schema public cascade").wait()
_ = try (a as! PostgresDatabase).query("create schema public").wait()

let b = self.dbs.database(.b, logger: Logger(label: "test.fluent.b"), on: self.eventLoopGroup.next())
let b = self.dbs.database(.b, logger: Logger(label: "test.fluent.b"), on: self.eventLoopGroup.any())
_ = try (b as! PostgresDatabase).query("drop schema public cascade").wait()
_ = try (b as! PostgresDatabase).query("create schema public").wait()
}
Expand All @@ -225,9 +225,9 @@ extension DatabaseConfigurationFactory {
let baseSubconfig = PostgresConfiguration(
hostname: env("POSTGRES_HOSTNAME_\(subconfig)") ?? "localhost",
port: env("POSTGRES_PORT_\(subconfig)").flatMap(Int.init) ?? PostgresConfiguration.ianaPortNumber,
username: env("POSTGRES_USER_\(subconfig)") ?? "vapor_username",
password: env("POSTGRES_PASSWORD_\(subconfig)") ?? "vapor_password",
database: env("POSTGRES_DB_\(subconfig)") ?? "vapor_database"
username: env("POSTGRES_USER_\(subconfig)") ?? "test_username",
password: env("POSTGRES_PASSWORD_\(subconfig)") ?? "test_password",
database: env("POSTGRES_DB_\(subconfig)") ?? "test_database"
)

return .postgres(configuration: baseSubconfig, connectionPoolTimeout: .seconds(30), encoder: encoder, decoder: decoder)
Expand Down