Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recommend against poolCheckout for DBI #189

Merged
merged 1 commit into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.

Loading