             values[idx] = UnsafePointer<Int8>(OpaquePointer(tempValues.last!))
         }
 
-        guard let res = PQexecParams(self.conn, statement, Int32(params.count),
-                                     nil, values, nil, nil, Int32(0)) else {
-            try failWithError(); return nil
+        guard let res = PQexecParams(self.conn, statement, Int32(params.count), nil, values, nil, nil, Int32(0)) else {
+            throw failWithError()
         }
 
         return try validateQueryResultStatus(res)


    private func close() throws {
        guard self.connected else {
            try failWithError(); return
        }

        PQfinish(conn)
        conn = nil
    }

    private func failWithError(_ conn: OpaquePointer? = nil) throws {
        let message = String(cString: PQerrorMessage(conn ?? self.conn))
        throw RopeError.connectionFailed(message: message)
    }
}

        let conn = PQsetdbLogin(host, String(port), "", "", dbName, user, password)

        guard PQstatus(conn) == CONNECTION_OK else {
            throw failWithError(conn)
        }

        self.conn = conn
