Skip to content

Fix #23: namespace-qualify DBI calls with pool:: - #26

Merged
jspijker merged 1 commit into
developfrom
jspijker-issue23
Aug 27, 2026
Merged

jspijker merged 1 commit into
developfrom
jspijker-issue23

Conversation

@jspijker

Copy link
Copy Markdown
Collaborator

Summary

Fixes #23.

Several DBI generics (dbGetQuery, dbExecute, dbWriteTable) were called without a namespace prefix. When DBI/pool isn't attached to the search path, these resolve to nothing and produce errors like:

Error in `dbGetQuery(conn, qry)`: could not find function "dbGetQuery"

DBI isn't even listed in the package Depends/Imports, so relying on it being attached is fragile. This PR qualifies all such calls with pool::, matching the pattern already used elsewhere in the package (e.g. create_database_tables.R, drop_database_tables.R, fun-timeranges.R).

Changes

Qualified 8 call sites across 6 files:

File Call
R/doc_exists.R dbGetQuery → pool::dbGetQuery
R/fun-db.R dbWriteTable, 2× dbExecute, dbGetQuery
R/add_doc.R dbExecute → pool::dbExecute
R/get_doc.R dbGetQuery → pool::dbGetQuery
R/insert_location_info.R dbExecute → pool::dbExecute
R/remove_doc.R dbExecute → pool::dbExecute

No DESCRIPTION/NAMESPACE changes needed — pool is already a dependency.

Testing

Could not run the testthat suite locally (no R toolchain available in the environment). The change is mechanical and consistent with existing working code; the R-CMD-check workflow will exercise the full test suite on this PR.

Several DBI generics (dbGetQuery, dbExecute, dbWriteTable) were called
without a namespace prefix, causing 'could not find function' errors
when DBI/pool is not attached to the search path. Qualify all such
calls with pool::, matching the pattern used elsewhere in the package.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@jspijker jspijker self-assigned this Aug 27, 2026
@jspijker
jspijker changed the base branch from main to develop August 27, 2026 08:41
@jspijker
jspijker merged commit 9142816 into develop Aug 27, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error when sqlite pks is not loaded

1 participant