Skip to content

Commit

Permalink
fixup! Closes finagle#75 - change PostgresClientImpl to not cache fai…
Browse files Browse the repository at this point in the history
…lures
  • Loading branch information
leonmaia committed Nov 13, 2018
1 parent ff35a61 commit 27f45fd
Showing 1 changed file with 17 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -154,25 +154,32 @@ class PostgresClientImpl(
* Issue a single, prepared SELECT query and wrap the response rows with the provided function.
*/
override def prepareAndQuery[T](sql: String, params: Param[_]*)(f: Row => T): Future[Seq[T]] = {
for {
service <- factory()
statement = new PreparedStatementImpl("", sql, service)
result <- statement.select(params: _*)(f)
} yield result
typeMap().flatMap { _ =>
for {
service <- factory()
statement = new PreparedStatementImpl("", sql, service)
result <- statement.select(params: _*)(f)
} yield result
}
}

/*
* Issue a single, prepared arbitrary query without an expected result set, and provide the affected row count
*/
override def prepareAndExecute(sql: String, params: Param[_]*):Future[Int] = for {
service <- factory()
statement = new PreparedStatementImpl("", sql, service)
OK(count) <- statement.exec(params: _*)
} yield count
override def prepareAndExecute(sql: String, params: Param[_]*): Future[Int] = {
typeMap().flatMap { _ =>
for {
service <- factory()
statement = new PreparedStatementImpl("", sql, service)
OK(count) <- statement.exec(params: _*)
} yield count
}
}


/**
* Close the underlying connection pool and make this Client eternally down
*
* @return
*/
override def close(): Future[Unit] = {
Expand Down

0 comments on commit 27f45fd

Please sign in to comment.