Skip to content

Commit

Permalink
Merge pull request #189 from rstudio/pool-checkout-doc-tweaks
Browse files Browse the repository at this point in the history
Recommend against poolCheckout for DBI
  • Loading branch information
jcheng5 authored Aug 21, 2024
2 parents 5fece66 + 3cd4af3 commit 0fa16fa
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions R/pool-methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,18 @@ setMethod("poolClose", "Pool", function(pool) {
#' Note that validation is only performed when the object is checked out,
#' so you generally want to keep the checked out around for as little time as
#' possible.
#'
#' When pooling DBI database connections, you normally would not use
#' `poolCheckout()`. Instead, for single-shot queries, treat the pool object
#' itself as the DBI connection object and it will perform checkout/return for
#' you. And for transactions, use [poolWithTransaction()].
#'
#' @param pool The pool to get the object from.
#' @export
#' @examples
#' pool <- dbPool(RSQLite::SQLite())
#' # For illustration only. You normally would not explicitly use
#' # poolCheckout with a DBI connection pool (see Description).
#' con <- poolCheckout(pool)
#' con
#' poolReturn(con)
Expand Down
7 changes: 7 additions & 0 deletions man/poolCheckout.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0fa16fa

Please sign in to comment.