1
1
import Logging
2
2
import FluentKit
3
+ import AsyncKit
3
4
import NIOCore
5
+ import NIOSSL
6
+ import Foundation
4
7
import PostgresKit
5
8
6
9
extension DatabaseConfigurationFactory {
7
10
public static func postgres(
8
11
url urlString: String ,
9
12
maxConnectionsPerEventLoop: Int = 1 ,
10
- connectionPoolTimeout: NIO . TimeAmount = . seconds( 10 ) ,
13
+ connectionPoolTimeout: TimeAmount = . seconds( 10 ) ,
11
14
encoder: PostgresDataEncoder = . init( ) ,
12
15
decoder: PostgresDataDecoder = . init( ) ,
13
16
sqlLogLevel: Logger . Level = . debug
@@ -28,7 +31,7 @@ extension DatabaseConfigurationFactory {
28
31
public static func postgres(
29
32
url: URL ,
30
33
maxConnectionsPerEventLoop: Int = 1 ,
31
- connectionPoolTimeout: NIO . TimeAmount = . seconds( 10 ) ,
34
+ connectionPoolTimeout: TimeAmount = . seconds( 10 ) ,
32
35
encoder: PostgresDataEncoder = . init( ) ,
33
36
decoder: PostgresDataDecoder = . init( ) ,
34
37
sqlLogLevel: Logger . Level = . debug
@@ -52,7 +55,7 @@ extension DatabaseConfigurationFactory {
52
55
database: String ? = nil ,
53
56
tlsConfiguration: TLSConfiguration ? = nil ,
54
57
maxConnectionsPerEventLoop: Int = 1 ,
55
- connectionPoolTimeout: NIO . TimeAmount = . seconds( 10 ) ,
58
+ connectionPoolTimeout: TimeAmount = . seconds( 10 ) ,
56
59
encoder: PostgresDataEncoder = . init( ) ,
57
60
decoder: PostgresDataDecoder = . init( ) ,
58
61
sqlLogLevel: Logger . Level = . debug
@@ -75,7 +78,7 @@ extension DatabaseConfigurationFactory {
75
78
public static func postgres(
76
79
configuration: PostgresConfiguration ,
77
80
maxConnectionsPerEventLoop: Int = 1 ,
78
- connectionPoolTimeout: NIO . TimeAmount = . seconds( 10 ) ,
81
+ connectionPoolTimeout: TimeAmount = . seconds( 10 ) ,
79
82
encoder: PostgresDataEncoder = . init( ) ,
80
83
decoder: PostgresDataDecoder = . init( ) ,
81
84
sqlLogLevel: Logger . Level = . debug
@@ -100,7 +103,7 @@ struct FluentPostgresConfiguration: DatabaseConfiguration {
100
103
let maxConnectionsPerEventLoop : Int
101
104
/// The amount of time to wait for a connection from
102
105
/// the connection pool before timing out.
103
- let connectionPoolTimeout : NIO . TimeAmount
106
+ let connectionPoolTimeout : TimeAmount
104
107
let encoder : PostgresDataEncoder
105
108
let decoder : PostgresDataDecoder
106
109
let sqlLogLevel : Logger . Level
0 commit comments