File tree Expand file tree Collapse file tree 3 files changed +10
-0
lines changed
Sources/PostgresNIO/Connection Expand file tree Collapse file tree 3 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ public struct PostgresCopyFromWriter: Sendable {
29
29
}
30
30
}
31
31
32
+ #if compiler(>=6.0)
32
33
/// Send data for a `COPY ... FROM STDIN` operation to the backend.
33
34
///
34
35
/// - Throws: If an error occurs during the write of if the backend sent an `ErrorResponse` during the copy
@@ -96,6 +97,7 @@ public struct PostgresCopyFromWriter: Sendable {
96
97
}
97
98
}
98
99
}
100
+ #endif
99
101
}
100
102
101
103
/// Specifies the format in which data is transferred to the backend in a COPY operation.
@@ -124,6 +126,7 @@ public struct PostgresCopyFromFormat: Sendable {
124
126
}
125
127
}
126
128
129
+ #if compiler(>=6.0)
127
130
/// Create a `COPY ... FROM STDIN` query based on the given parameters.
128
131
///
129
132
/// An empty `columns` array signifies that no columns should be specified in the query and that all columns will be
@@ -221,3 +224,4 @@ extension PostgresConnection {
221
224
try await writer. done ( )
222
225
}
223
226
}
227
+ #endif
Original file line number Diff line number Diff line change @@ -379,6 +379,7 @@ final class IntegrationTests: XCTestCase {
379
379
}
380
380
}
381
381
382
+ #if compiler(>=6.0)
382
383
func testCopyIntoFrom( ) async throws {
383
384
let eventLoopGroup = MultiThreadedEventLoopGroup ( numberOfThreads: 2 )
384
385
defer { XCTAssertNoThrow ( try eventLoopGroup. syncShutdownGracefully ( ) ) }
@@ -487,4 +488,5 @@ final class IntegrationTests: XCTestCase {
487
488
XCTAssertEqual ( ( error as? PSQLError ) ? . serverInfo ? [ . sqlState] , " 42601 " ) // scanner_yyerror
488
489
}
489
490
}
491
+ #endif
490
492
}
Original file line number Diff line number Diff line change @@ -625,6 +625,7 @@ class PostgresConnectionTests: XCTestCase {
625
625
}
626
626
}
627
627
628
+ #if compiler(>=6.0)
628
629
func testCopyFromSucceeds( ) async throws {
629
630
try await assertCopyFrom { writer in
630
631
try await writer. write ( ByteBuffer ( staticString: " 1 \t Alice \n " ) )
@@ -911,6 +912,7 @@ class PostgresConnectionTests: XCTestCase {
911
912
try await connection. closeFuture. get ( )
912
913
}
913
914
}
915
+ #endif
914
916
915
917
func makeTestConnectionWithAsyncTestingChannel( ) async throws -> ( PostgresConnection , NIOAsyncTestingChannel ) {
916
918
let eventLoop = NIOAsyncTestingEventLoop ( )
@@ -944,6 +946,7 @@ class PostgresConnectionTests: XCTestCase {
944
946
return ( connection, channel)
945
947
}
946
948
949
+ #if compiler(>=6.0)
947
950
/// Validate the behavior of a `COPY FROM` query.
948
951
///
949
952
/// Also checks that the connection returns to an idle state after performing the copy and is capable
@@ -1011,6 +1014,7 @@ class PostgresConnectionTests: XCTestCase {
1011
1014
_ = try await channel. waitForUnpreparedRequest ( ) // Await the dummy query messages
1012
1015
}
1013
1016
}
1017
+ #endif
1014
1018
}
1015
1019
1016
1020
extension NIOAsyncTestingChannel {
You can’t perform that action at this time.
0 commit comments