Skip to content

Commit ea2d7d2

Browse files
committed
Remove no-longer-needed Sendable workaround
1 parent add0283 commit ea2d7d2

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

Sources/FluentPostgresDriver/FluentPostgresConfiguration.swift

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,7 @@ extension DatabaseConfigurationFactory {
8282
decodingContext: PostgresDecodingContext<some PostgresJSONDecoder>,
8383
sqlLogLevel: Logger.Level = .debug
8484
) -> DatabaseConfigurationFactory {
85-
let configuration = FakeSendable(wrappedValue: configuration)
86-
87-
return .init {
85+
.init {
8886
FluentPostgresConfiguration(
8987
configuration: configuration,
9088
maxConnectionsPerEventLoop: maxConnectionsPerEventLoop,
@@ -97,8 +95,6 @@ extension DatabaseConfigurationFactory {
9795
}
9896
}
9997

100-
private struct FakeSendable<T>: @unchecked Sendable { let wrappedValue: T }
101-
10298
/// We'd like to just default the context parameters of the "actual" method. Unfortunately, there are a few
10399
/// cases involving the UNIX domain socket initalizer where usage can resolve to either the new
104100
/// `SQLPostgresConfiguration`-based method or the deprecated `PostgresConfiguration`-based method, with no
@@ -172,15 +168,15 @@ extension DatabaseConfigurationFactory {
172168
/// The actual concrete configuration type produced by a configuration factory.
173169
struct FluentPostgresConfiguration<E: PostgresJSONEncoder, D: PostgresJSONDecoder>: DatabaseConfiguration {
174170
var middleware: [any AnyModelMiddleware] = []
175-
fileprivate let configuration: FakeSendable<SQLPostgresConfiguration>
171+
fileprivate let configuration: SQLPostgresConfiguration
176172
let maxConnectionsPerEventLoop: Int
177173
let connectionPoolTimeout: TimeAmount
178174
let encodingContext: PostgresEncodingContext<E>
179175
let decodingContext: PostgresDecodingContext<D>
180176
let sqlLogLevel: Logger.Level
181177

182178
func makeDriver(for databases: Databases) -> any DatabaseDriver {
183-
let connectionSource = PostgresConnectionSource(sqlConfiguration: self.configuration.wrappedValue)
179+
let connectionSource = PostgresConnectionSource(sqlConfiguration: self.configuration)
184180
let elgPool = EventLoopGroupConnectionPool(
185181
source: connectionSource,
186182
maxConnectionsPerEventLoop: self.maxConnectionsPerEventLoop,

0 commit comments

Comments
 (0)