Skip to content

Add PGWEB_BOOKMARKS_DIR environment variable#837

Merged
sosedoff merged 3 commits intomainfrom
feature/configurable-bookmarks-dir
Feb 1, 2026
Merged

Add PGWEB_BOOKMARKS_DIR environment variable#837
sosedoff merged 3 commits intomainfrom
feature/configurable-bookmarks-dir

Conversation

@sosedoff
Copy link
Owner

@sosedoff sosedoff commented Feb 1, 2026

Summary

  • Adds support for the PGWEB_BOOKMARKS_DIR environment variable to configure the bookmarks directory, complementing the existing --bookmarks-dir CLI flag
  • Follows the established PGWEB_* naming convention and integrates with getPrefixedEnvVar(), which provides backwards-compatible fallback to unprefixed BOOKMARKS_DIR with a deprecation warning
  • Priority order: --bookmarks-dir flag > PGWEB_BOOKMARKS_DIR env var > default $HOME/.pgweb/bookmarks

Test plan

  • New test: env var sets the bookmarks directory when no flag is provided
  • New test: CLI flag takes precedence over env var
  • Existing tests continue to pass (defaults, bookmarks-only mode, etc.)
  • Full build succeeds (go build ./...)
  • Verify manually: PGWEB_BOOKMARKS_DIR=/tmp/bookmarks pgweb uses the specified directory

🤖 Generated with Claude Code

sosedoff and others added 3 commits January 31, 2026 19:07
…irectory

Allow the bookmarks directory to be set via the PGWEB_BOOKMARKS_DIR
environment variable, in addition to the existing --bookmarks-dir flag.
Priority: CLI flag > env var > default ($HOME/.pgweb/bookmarks).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The go-flags library treats "/" as an option prefix on Windows, causing
ParseOptions to misinterpret "/tmp/flag-bookmarks" as a flag. Use
t.TempDir() which produces a platform-appropriate temporary directory.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@sosedoff sosedoff merged commit 305f979 into main Feb 1, 2026
13 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.

1 participant