Skip to content

Commit 08c0dc5

Browse files
authored
Fix NIO imports (#171)
### Motivation - SwiftNIO 2.32.0 introduces explicit modules for its Core and Posix. - To write great platform independent code in most parts we should only ever import `NIOCore` ### Changes - This pr explicitly imports NIOCore, NIOPosix and NIOEmbedded where needed.
1 parent 6f6ec7b commit 08c0dc5

File tree

145 files changed

+219
-90
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

145 files changed

+219
-90
lines changed

Package.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ let package = Package(
1313
.library(name: "PostgresNIO", targets: ["PostgresNIO"]),
1414
],
1515
dependencies: [
16-
.package(url: "https://github.com/apple/swift-nio.git", from: "2.28.0"),
16+
.package(url: "https://github.com/apple/swift-nio.git", from: "2.32.0"),
1717
.package(url: "https://github.com/apple/swift-nio-ssl.git", from: "2.12.0"),
1818
.package(url: "https://github.com/apple/swift-crypto.git", from: "1.0.0"),
1919
.package(url: "https://github.com/apple/swift-metrics.git", from: "2.0.0"),
@@ -25,12 +25,15 @@ let package = Package(
2525
.product(name: "Logging", package: "swift-log"),
2626
.product(name: "Metrics", package: "swift-metrics"),
2727
.product(name: "NIO", package: "swift-nio"),
28+
.product(name: "NIOCore", package: "swift-nio"),
29+
.product(name: "NIOPosix", package: "swift-nio"),
2830
.product(name: "NIOTLS", package: "swift-nio"),
29-
.product(name: "NIOFoundationCompat", package: "swift-nio"),
3031
.product(name: "NIOSSL", package: "swift-nio-ssl"),
32+
.product(name: "NIOFoundationCompat", package: "swift-nio"),
3133
]),
3234
.testTarget(name: "PostgresNIOTests", dependencies: [
3335
.target(name: "PostgresNIO"),
36+
.product(name: "NIOEmbedded", package: "swift-nio"),
3437
.product(name: "NIOTestUtils", package: "swift-nio"),
3538
]),
3639
.testTarget(name: "IntegrationTests", dependencies: [

Sources/PostgresNIO/Connection/PostgresConnection+Authenticate.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import NIO
1+
import NIOCore
2+
import Logging
23

34
extension PostgresConnection {
45
public func authenticate(

Sources/PostgresNIO/Connection/PostgresConnection+Connect.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
import NIO
1+
import NIOCore
2+
import NIOSSL
3+
import Logging
24

35
extension PostgresConnection {
46
public static func connect(

Sources/PostgresNIO/Connection/PostgresConnection+Database.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import NIOCore
12
import Logging
23
import struct Foundation.Data
34

Sources/PostgresNIO/Connection/PostgresConnection+Notifications.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import NIO
1+
import NIOCore
22
import Logging
33

44
/// Context for receiving NotificationResponse messages on a connection, used for PostgreSQL's `LISTEN`/`NOTIFY` support.

Sources/PostgresNIO/Connection/PostgresConnection.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import NIO
1+
import NIOCore
22
import Logging
33
import struct Foundation.UUID
44

Sources/PostgresNIO/Connection/PostgresDatabase+PreparedQuery.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import Foundation
1+
import NIOCore
2+
import struct Foundation.UUID
23

34
extension PostgresDatabase {
45
public func prepare(query: String) -> EventLoopFuture<PreparedQuery> {

Sources/PostgresNIO/Data/PostgresData+Array.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import NIOCore
2+
13
extension PostgresData {
24
public init<T>(array: [T])
35
where T: PostgresDataConvertible

Sources/PostgresNIO/Data/PostgresData+Bool.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import NIOCore
2+
13
extension PostgresData {
24
public init(bool: Bool) {
35
var buffer = ByteBufferAllocator().buffer(capacity: 1)

Sources/PostgresNIO/Data/PostgresData+Bytes.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import struct Foundation.Data
2+
import NIOCore
23

34
extension PostgresData {
45
public init<Bytes>(bytes: Bytes)

0 commit comments

Comments
 (0)