Document package connection lifetime - #682
Conversation
Formatting suggestions availableA patch file with formatting suggestions has been generated. You can apply it using one of these methods: Method 1: Apply via gh CLI# Download and apply the patch directly
gh run download 27011862185 --repo r-dbi/DBI --name changes-patch && patch -p1 < changes.patch && rm changes.patchRepo owners can also apply the patch automatically. Click the button to jump to the comment box, then post: Method 2: View the patchClick to see the patch contentsdiff --git a/man/dbDisconnect.Rd b/man/dbDisconnect.Rd
index 9bbc389..b4f3377 100644
--- a/man/dbDisconnect.Rd
+++ b/man/dbDisconnect.Rd
@@ -21,6 +21,15 @@ resources (e.g., memory, sockets).
\Sexpr[results=rd,stage=render]{DBI:::methods_as_rd("dbDisconnect")}
}
+\section{Connection lifetime in packages}{
+
+For package-level connection reuse, consider delegating connection lifetime
+management to the pool package. If a package manages a long-lived connection
+itself, any finalizer that calls \code{dbDisconnect()} should keep the connection
+object reachable until the finalizer runs, and should check \code{\link[=dbIsValid]{dbIsValid()}}
+before disconnecting.
+}
+
\section{Failure modes}{
@@ -31,15 +40,6 @@ At least one warning is issued immediately when calling \code{dbDisconnect()} on
already disconnected
or invalid connection.
-}
-\section{Connection lifetime in packages}{
-
-For package-level connection reuse, consider delegating connection lifetime
-management to the pool package. If a package manages a long-lived connection
-itself, any finalizer that calls \code{dbDisconnect()} should keep the connection
-object reachable until the finalizer runs, and should check \code{\link[=dbIsValid]{dbIsValid()}}
-before disconnecting.
-
}
\examples{This comment was automatically generated by the commit-suggester workflow. |
SummaryI rechecked this PR locally today and did not make further code changes. Thanks to maintainersThanks again for the guidance on documenting this package-level connection-lifetime pattern. Issue or motivationMy last note could read as if the PR were fully green. It is not: the branch is locally validated, but the PR is still blocked by one upstream CI failure. Root causeAt the moment, every visible PR check is successful except ChangeNo code changes today. I only rechecked the current head and confirmed that the Tests
ScopeI did not change the wording beyond the existing PR, did not touch workflows, and did not push a new commit. I also cannot rerun the upstream failed job from a fork because that requires repository admin rights. |
Fixes #532.
This adds a short
dbDisconnect()documentation section for package-level connection reuse. It keeps the guidance conservative:dbIsValid()Checks:
git diff --checkR CMD build --no-build-vignettes ._R_CHECK_FORCE_SUGGESTS_=false R CMD check --no-manual --ignore-vignettes --no-build-vignettes --no-tests DBI_1.3.0.9010.tar.gz