Skip to content

lnk_wsg_resolve: optional conn arg + study_area_wsgs.R passes local-fwapg conn (v0.41.3)#211

Merged
NewGraphEnvironment merged 1 commit into
mainfrom
lnk-wsg-resolve-conn-arg
May 28, 2026
Merged

lnk_wsg_resolve: optional conn arg + study_area_wsgs.R passes local-fwapg conn (v0.41.3)#211
NewGraphEnvironment merged 1 commit into
mainfrom
lnk-wsg-resolve-conn-arg

Conversation

@NewGraphEnvironment

Copy link
Copy Markdown
Owner

Summary

lnk_wsg_resolve()s closure mode opened its own connection via lnk_db_conn(), which honours PG_*_SHARE env vars. On M1 those ~/.Renviron-pinned defaults point at the db_newgraph tunnel (:63333) which is dead — every other driver script already dodges this by passing explicit host/port to lnk_db_conn() (or opening DBI::dbConnect directly to localhost:5432/fwapg).

  • Adds conn = NULL (default) optional argument to lnk_wsg_resolve(). When NULL, behaviour is unchanged — opens via lnk_db_conn() as before. When provided, that conn is used (no internal on.exit-cleanup; caller owns lifecycle).
  • data-raw/study_area_wsgs.R now opens a local docker fwapg connection explicitly and passes it through. Matches the pre-lnk_wsg_resolve: bundle-aware WSG resolver (closure + species filter); study_area_wsgs.R → CLI shim #207 inline behaviour and every other driver script (wsg_run_one.R, wsg_compare.R).
  • Strict + province modes remain DB-free; conn consulted only in closure mode.

Related Issues

  • Relates to NewGraphEnvironment/sred#24

Test plan

  • Existing 22 tests still pass (new conn arg has default, no test breakage)
  • Discovered live: bash data-raw/study_area_run.sh --config=default --schema=fresh_default ... failed at the bucket-resolve step with connection to server at ":::1", port 63333 failed: Connection refused — fix lets it through
  • Relaunch the study-area run after this lands

🤖 Generated with Claude Code

…-fwapg conn (v0.41.3)

lnk_wsg_resolve()'s closure mode opened its own connection via
lnk_db_conn(), which honours PG_*_SHARE env vars. On M1 those default
to the db_newgraph tunnel (:63333) which is dead — every driver script
already dodges this by passing explicit host/port to lnk_db_conn() (or
opening DBI::dbConnect directly to localhost:5432/fwapg).

Adds `conn = NULL` (default) — opens via lnk_db_conn() as before — plus
the option to pass an explicit DBI connection. study_area_wsgs.R now
opens its own local-fwapg conn (mirroring wsg_run_one.R, wsg_compare.R,
and the pre-#207 inline behaviour) and passes it through. Strict +
province modes remain DB-free.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@NewGraphEnvironment NewGraphEnvironment merged commit b04280d into main May 28, 2026
1 check passed
@NewGraphEnvironment NewGraphEnvironment deleted the lnk-wsg-resolve-conn-arg branch May 28, 2026 05:36
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.

1 participant