Skip to content

Commit

Permalink
Merge pull request #20 from vapor/connection-config
Browse files Browse the repository at this point in the history
update to dbkit beta 3 & remove connection config
  • Loading branch information
tanner0101 authored Feb 16, 2018
2 parents 29b446c + 53c619b commit 6ce7b99
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 28 deletions.
5 changes: 1 addition & 4 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@ let package = Package(
.package(url: "https://github.com/vapor/crypto.git", "3.0.0-beta.1"..<"3.0.0-beta.2"),

// Core services for creating database integrations.
.package(url: "https://github.com/vapor/database-kit.git", "1.0.0-beta.2"..<"1.0.0-beta.3"),

// Non-blocking networking for Swift (HTTP and WebSockets).
.package(url: "https://github.com/vapor/engine.git", "3.0.0-beta.2"..<"3.0.0-beta.3"),
.package(url: "https://github.com/vapor/database-kit.git", "1.0.0-beta.3"..<"1.0.0-beta.4"),

// Service container and configuration system.
.package(url: "https://github.com/vapor/service.git", "1.0.0-beta.1"..<"1.0.0-beta.2"),
Expand Down
2 changes: 1 addition & 1 deletion Sources/PostgreSQL/Data/PostgreSQLData.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public struct PostgreSQLData {
extension PostgreSQLData: CustomStringConvertible {
/// See `CustomStringConvertible.description`
public var description: String {
return "\(type) (\(format)) \(data?.hexDebug ?? "nil")"
return "\(type) (\(format)) \(data?.hexDebug ?? "null")"
}
}

Expand Down
10 changes: 0 additions & 10 deletions Sources/PostgreSQL/Database/PostgreSQLConnectionConfig.swift

This file was deleted.

7 changes: 2 additions & 5 deletions Sources/PostgreSQL/Database/PostgreSQLDatabase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public final class PostgreSQLDatabase: Database {
}

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

/// A connection created by a `PostgreSQLDatabase`.
extension PostgreSQLConnection: DatabaseConnection {
/// See `DatabaseConnection.Config`
public typealias Config = PostgreSQLConnectionConfig
}
extension PostgreSQLConnection: DatabaseConnection { }

extension DatabaseIdentifier {
/// Default identifier for `PostgreSQLDatabase`.
Expand Down
8 changes: 0 additions & 8 deletions Sources/PostgreSQL/PostgreSQLProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ public final class PostgreSQLProvider: Provider {
/// See `Provider.register`
public func register(_ services: inout Services) throws {
try services.register(DatabaseKitProvider())
services.register(PostgreSQLConnectionConfig.self)
services.register(PostgreSQLDatabaseConfig.self)
services.register(PostgreSQLDatabase.self)
var databases = DatabaseConfig()
Expand All @@ -25,13 +24,6 @@ public final class PostgreSQLProvider: Provider {

/// MARK: Services

extension PostgreSQLConnectionConfig: ServiceType {
/// See `ServiceType.makeService(for:)`
public static func makeService(for worker: Container) throws -> PostgreSQLConnectionConfig {
return .default()
}
}

extension PostgreSQLDatabaseConfig: ServiceType {
/// See `ServiceType.makeService(for:)`
public static func makeService(for worker: Container) throws -> PostgreSQLDatabaseConfig {
Expand Down

0 comments on commit 6ce7b99

Please sign in to comment.