Skip to content

Commit 6ce7b99

Browse files
authored
Merge pull request #20 from vapor/connection-config
update to dbkit beta 3 & remove connection config
2 parents 29b446c + 53c619b commit 6ce7b99

File tree

5 files changed

+4
-28
lines changed

5 files changed

+4
-28
lines changed

Package.swift

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,7 @@ let package = Package(
1717
.package(url: "https://github.com/vapor/crypto.git", "3.0.0-beta.1"..<"3.0.0-beta.2"),
1818

1919
// Core services for creating database integrations.
20-
.package(url: "https://github.com/vapor/database-kit.git", "1.0.0-beta.2"..<"1.0.0-beta.3"),
21-
22-
// Non-blocking networking for Swift (HTTP and WebSockets).
23-
.package(url: "https://github.com/vapor/engine.git", "3.0.0-beta.2"..<"3.0.0-beta.3"),
20+
.package(url: "https://github.com/vapor/database-kit.git", "1.0.0-beta.3"..<"1.0.0-beta.4"),
2421

2522
// Service container and configuration system.
2623
.package(url: "https://github.com/vapor/service.git", "1.0.0-beta.1"..<"1.0.0-beta.2"),

Sources/PostgreSQL/Data/PostgreSQLData.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public struct PostgreSQLData {
2121
extension PostgreSQLData: CustomStringConvertible {
2222
/// See `CustomStringConvertible.description`
2323
public var description: String {
24-
return "\(type) (\(format)) \(data?.hexDebug ?? "nil")"
24+
return "\(type) (\(format)) \(data?.hexDebug ?? "null")"
2525
}
2626
}
2727

Sources/PostgreSQL/Database/PostgreSQLConnectionConfig.swift

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

Sources/PostgreSQL/Database/PostgreSQLDatabase.swift

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public final class PostgreSQLDatabase: Database {
1414
}
1515

1616
/// See `Database.makeConnection()`
17-
public func makeConnection(using connectionConfig: PostgreSQLConnectionConfig, on worker: Worker) -> Future<PostgreSQLConnection> {
17+
public func makeConnection(on worker: Worker) -> Future<PostgreSQLConnection> {
1818
do {
1919
let client = try PostgreSQLConnection.connect(hostname: config.hostname, port: config.port, on: worker) { _, error in
2020
print("[PostgreSQL] \(error)")
@@ -32,10 +32,7 @@ public final class PostgreSQLDatabase: Database {
3232
}
3333

3434
/// A connection created by a `PostgreSQLDatabase`.
35-
extension PostgreSQLConnection: DatabaseConnection {
36-
/// See `DatabaseConnection.Config`
37-
public typealias Config = PostgreSQLConnectionConfig
38-
}
35+
extension PostgreSQLConnection: DatabaseConnection { }
3936

4037
extension DatabaseIdentifier {
4138
/// Default identifier for `PostgreSQLDatabase`.

Sources/PostgreSQL/PostgreSQLProvider.swift

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ public final class PostgreSQLProvider: Provider {
1111
/// See `Provider.register`
1212
public func register(_ services: inout Services) throws {
1313
try services.register(DatabaseKitProvider())
14-
services.register(PostgreSQLConnectionConfig.self)
1514
services.register(PostgreSQLDatabaseConfig.self)
1615
services.register(PostgreSQLDatabase.self)
1716
var databases = DatabaseConfig()
@@ -25,13 +24,6 @@ public final class PostgreSQLProvider: Provider {
2524

2625
/// MARK: Services
2726

28-
extension PostgreSQLConnectionConfig: ServiceType {
29-
/// See `ServiceType.makeService(for:)`
30-
public static func makeService(for worker: Container) throws -> PostgreSQLConnectionConfig {
31-
return .default()
32-
}
33-
}
34-
3527
extension PostgreSQLDatabaseConfig: ServiceType {
3628
/// See `ServiceType.makeService(for:)`
3729
public static func makeService(for worker: Container) throws -> PostgreSQLDatabaseConfig {

0 commit comments

Comments
 (0)