Skip to content

Commit

Permalink
fix: use PQStatus during isConnected check (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
David Dunn authored and djones6 committed Apr 18, 2018
1 parent bb8d0d2 commit 4177014
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/SwiftKueryPostgreSQL/PostgreSQLConnection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public class PostgreSQLConnection: Connection {

/// An indication whether there is a connection to the database.
public var isConnected: Bool {
return connection != nil
return connection != nil && PQstatus(connection) == CONNECTION_OK
}

/// The `QueryBuilder` with PostgreSQL specific substitutions.
Expand Down

0 comments on commit 4177014

Please sign in to comment.