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 {
2929 }
3030 }
3131
32+ #if compiler(>=6.0)
3233 /// Send data for a `COPY ... FROM STDIN` operation to the backend.
3334 ///
3435 /// - 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 {
9697 }
9798 }
9899 }
100+ #endif
99101}
100102
101103/// Specifies the format in which data is transferred to the backend in a COPY operation.
@@ -124,6 +126,7 @@ public struct PostgresCopyFromFormat: Sendable {
124126 }
125127}
126128
129+ #if compiler(>=6.0)
127130/// Create a `COPY ... FROM STDIN` query based on the given parameters.
128131///
129132/// 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 {
221224 try await writer. done ( )
222225 }
223226}
227+ #endif
Original file line number Diff line number Diff line change @@ -379,6 +379,7 @@ final class IntegrationTests: XCTestCase {
379379 }
380380 }
381381
382+ #if compiler(>=6.0)
382383 func testCopyIntoFrom( ) async throws {
383384 let eventLoopGroup = MultiThreadedEventLoopGroup ( numberOfThreads: 2 )
384385 defer { XCTAssertNoThrow ( try eventLoopGroup. syncShutdownGracefully ( ) ) }
@@ -487,4 +488,5 @@ final class IntegrationTests: XCTestCase {
487488 XCTAssertEqual ( ( error as? PSQLError ) ? . serverInfo ? [ . sqlState] , " 42601 " ) // scanner_yyerror
488489 }
489490 }
491+ #endif
490492}
Original file line number Diff line number Diff line change @@ -625,6 +625,7 @@ class PostgresConnectionTests: XCTestCase {
625625 }
626626 }
627627
628+ #if compiler(>=6.0)
628629 func testCopyFromSucceeds( ) async throws {
629630 try await assertCopyFrom { writer in
630631 try await writer. write ( ByteBuffer ( staticString: " 1 \t Alice \n " ) )
@@ -911,6 +912,7 @@ class PostgresConnectionTests: XCTestCase {
911912 try await connection. closeFuture. get ( )
912913 }
913914 }
915+ #endif
914916
915917 func makeTestConnectionWithAsyncTestingChannel( ) async throws -> ( PostgresConnection , NIOAsyncTestingChannel ) {
916918 let eventLoop = NIOAsyncTestingEventLoop ( )
@@ -944,6 +946,7 @@ class PostgresConnectionTests: XCTestCase {
944946 return ( connection, channel)
945947 }
946948
949+ #if compiler(>=6.0)
947950 /// Validate the behavior of a `COPY FROM` query.
948951 ///
949952 /// Also checks that the connection returns to an idle state after performing the copy and is capable
@@ -1011,6 +1014,7 @@ class PostgresConnectionTests: XCTestCase {
10111014 _ = try await channel. waitForUnpreparedRequest ( ) // Await the dummy query messages
10121015 }
10131016 }
1017+ #endif
10141018}
10151019
10161020extension NIOAsyncTestingChannel {
You can’t perform that action at this time.
0 commit comments