Skip to content

Commit fa42c43

Browse files
committed
cleanup extraneous files
1 parent 66aa574 commit fa42c43

File tree

5 files changed

+17
-208
lines changed

5 files changed

+17
-208
lines changed

Sources/PostgreSQL/Column/PostgreSQLDataType.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import Foundation
2-
31
/// The data type's raw object ID.
42
/// Use `select * from pg_type where oid = <idhere>;` to lookup more information.
53
public struct PostgreSQLDataType: Codable, Equatable, ExpressibleByIntegerLiteral {

Sources/PostgreSQL/Data/PostgreSQLArrayCustomConvertible.swift

Lines changed: 0 additions & 124 deletions
This file was deleted.

Sources/PostgreSQL/Database/PostgreSQLDatabase.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public final class PostgreSQLDatabase: Database, LogSupporting {
1919
return Future.flatMap(on: worker) {
2020
return try PostgreSQLConnection.connect(to: config.serverAddress, transport: config.transportConfig, on: worker) { error in
2121
ERROR(error.localizedDescription)
22-
}.flatMap(to: PostgreSQLConnection.self) { client in
22+
}.flatMap { client in
2323
return client.authenticate(
2424
username: config.username,
2525
database: config.database,

Sources/PostgreSQL/Utilities/Utilities.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ extension BinaryFloatingPoint {
154154
}
155155

156156
extension FixedWidthInteger {
157-
public func cast<T>(to value: T.Type) -> T? where T: FixedWidthInteger {
157+
func cast<T>(to value: T.Type) -> T? where T: FixedWidthInteger {
158158
if let existing = self as? T {
159159
return existing
160160
}

Tests/PostgreSQLTests/PostgreSQLConnectionTests.swift

Lines changed: 15 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -190,86 +190,6 @@ class PostgreSQLConnectionTests: XCTestCase {
190190
_ = try categories.wait()
191191
}
192192

193-
// func testNotifyAndListen() throws {
194-
// let completionHandlerExpectation1 = expectation(description: "first completion handler called")
195-
// let completionHandlerExpectation2 = expectation(description: "final completion handler called")
196-
// let notifyConn = try PostgreSQLConnection.makeTest()
197-
// let listenConn = try PostgreSQLConnection.makeTest()
198-
// let channelName = "Fooze"
199-
// let messageText = "Bar"
200-
// let finalMessageText = "Baz"
201-
//
202-
// try listenConn.listen(channelName) { text in
203-
// if text == messageText {
204-
// completionHandlerExpectation1.fulfill()
205-
// } else if text == finalMessageText {
206-
// completionHandlerExpectation2.fulfill()
207-
// }
208-
// }.catch({ err in XCTFail("error \(err)") })
209-
//
210-
// try notifyConn.notify(channelName, message: messageText).wait()
211-
// try notifyConn.notify(channelName, message: finalMessageText).wait()
212-
//
213-
// waitForExpectations(timeout: defaultTimeout)
214-
// notifyConn.close()
215-
// listenConn.close()
216-
// }
217-
//
218-
// func testNotifyAndListenOnMultipleChannels() throws {
219-
// let completionHandlerExpectation1 = expectation(description: "first completion handler called")
220-
// let completionHandlerExpectation2 = expectation(description: "final completion handler called")
221-
// let notifyConn = try PostgreSQLConnection.makeTest()
222-
// let listenConn = try PostgreSQLConnection.makeTest()
223-
// let channelName = "Fooze"
224-
// let channelName2 = "Foozalz"
225-
// let messageText = "Bar"
226-
// let finalMessageText = "Baz"
227-
//
228-
// try listenConn.listen(channelName) { text in
229-
// if text == messageText {
230-
// completionHandlerExpectation1.fulfill()
231-
// }
232-
// }.catch({ err in XCTFail("error \(err)") })
233-
//
234-
// try listenConn.listen(channelName2) { text in
235-
// if text == finalMessageText {
236-
// completionHandlerExpectation2.fulfill()
237-
// }
238-
// }.catch({ err in XCTFail("error \(err)") })
239-
//
240-
// try notifyConn.notify(channelName, message: messageText).wait()
241-
// try notifyConn.notify(channelName2, message: finalMessageText).wait()
242-
//
243-
// waitForExpectations(timeout: defaultTimeout)
244-
// notifyConn.close()
245-
// listenConn.close()
246-
// }
247-
//
248-
// func testUnlisten() throws {
249-
// let unlistenHandlerExpectation = expectation(description: "unlisten completion handler called")
250-
//
251-
// let listenHandlerExpectation = expectation(description: "listen completion handler called")
252-
//
253-
// let notifyConn = try PostgreSQLConnection.makeTest()
254-
// let listenConn = try PostgreSQLConnection.makeTest()
255-
// let channelName = "Foozers"
256-
// let messageText = "Bar"
257-
//
258-
// try listenConn.listen(channelName) { text in
259-
// if text == messageText {
260-
// listenHandlerExpectation.fulfill()
261-
// }
262-
// }.catch({ err in XCTFail("error \(err)") })
263-
//
264-
// try notifyConn.notify(channelName, message: messageText).wait()
265-
// try notifyConn.unlisten(channelName, unlistenHandler: {
266-
// unlistenHandlerExpectation.fulfill()
267-
// }).wait()
268-
// waitForExpectations(timeout: defaultTimeout)
269-
// notifyConn.close()
270-
// listenConn.close()
271-
// }
272-
273193
func testURLParsing() throws {
274194
let databaseURL = "postgres://username:password@localhost:5432/database"
275195
let config = try PostgreSQLDatabaseConfig(url: databaseURL)
@@ -553,7 +473,22 @@ class PostgreSQLConnectionTests: XCTestCase {
553473

554474
static var allTests = [
555475
("testVersion", testVersion),
476+
("testUnverifiedSSLConnection", testUnverifiedSSLConnection),
477+
("testSelectTypes", testSelectTypes),
478+
("testStruct", testStruct),
479+
("testNull", testNull),
480+
("testGH24", testGH24),
481+
("testURLParsing", testURLParsing),
482+
("testGH46", testGH46),
483+
("testDataDecoder", testDataDecoder),
484+
("testRowDecoder", testRowDecoder),
485+
("testRowCodableNested", testRowCodableNested),
486+
("testRowCodableTypes", testRowCodableTypes),
487+
("testDML", testDML),
488+
("testDMLNestedType", testDMLNestedType),
556489
("testTimeTz", testTimeTz),
490+
("testListen", testListen),
491+
("testSum", testSum),
557492
]
558493
}
559494

0 commit comments

Comments
 (0)