lnk_wsg_resolve: optional conn arg + study_area_wsgs.R passes local-fwapg conn (v0.41.3)#211
Merged
Merged
Conversation
…-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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
lnk_wsg_resolve()s closure mode opened its own connection vialnk_db_conn(), which honoursPG_*_SHAREenv 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 explicithost/porttolnk_db_conn()(or openingDBI::dbConnectdirectly tolocalhost:5432/fwapg).conn = NULL(default) optional argument tolnk_wsg_resolve(). When NULL, behaviour is unchanged — opens vialnk_db_conn()as before. When provided, that conn is used (no internalon.exit-cleanup; caller owns lifecycle).data-raw/study_area_wsgs.Rnow 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).connconsulted only in closure mode.Related Issues
Test plan
connarg has default, no test breakage)bash data-raw/study_area_run.sh --config=default --schema=fresh_default ...failed at the bucket-resolve step withconnection to server at ":::1", port 63333 failed: Connection refused— fix lets it through🤖 Generated with Claude Code