Skip to content

Conversation

@zwhitfield3
Copy link
Contributor

@zwhitfield3 zwhitfield3 commented Jan 24, 2026

Summary

Converts additional pg commands and their associated tests to ESM as part of the v11.0.0 upgrade.

Commands migrated:

  • pg:info - Display database information
  • pg:kill - Kill a backend connection
  • pg:killall - Terminate all backend connections
  • pg:locks - Display queries holding locks on your database
  • pg:outliers - Show queries that have longest execution time
  • pg:promote - Sets DATABASE as your DATABASE_URL

Libraries updated:

  • lib/pg/fetcher.ts - Removed unnecessary imports
  • lib/pg/psql.ts - Updated to use ESM exports

Tests migrated:

  • pg:info unit tests
  • pg:killall unit tests
  • pg:promote unit tests

Type of Change

Breaking Changes (major semver update)

  • Add a ! after your change type to denote a change that breaks current behavior

Feature Additions (minor semver update)

  • feat: Introduces a new feature to the codebase

Patch Updates (patch semver update)

  • fix: Bug fix
  • perf: Performance improvement
  • deps: Dependency upgrade
  • revert: Revert a previous commit
  • docs: Documentation change
  • style: Styling update
  • chore: Change that does not affect production code
  • refactor: Refactoring existing code without changing behavior
  • tests: Add/update/remove tests
  • build: Change to the build system
  • ci: Continuous integration workflow update

Testing

Notes:
Requires a Postgres database provisioned on a Heroku app.

Steps:
Pull down branch, npm install && npm run build

# Show help for migrated commands
./bin/run pg:info --help
./bin/run pg:kill --help
./bin/run pg:killall --help
./bin/run pg:locks --help
./bin/run pg:outliers --help
./bin/run pg:promote --help

# Test pg:info - Display database information
./bin/run pg:info --app $APP DATABASE_URL

# Test pg:locks - Display queries holding locks
./bin/run pg:locks --app $APP DATABASE_URL

# Test pg:outliers - Show longest running queries
./bin/run pg:outliers --app $APP DATABASE_URL

# Test pg:killall - Terminate all connections (use with caution!)
./bin/run pg:killall --app $APP DATABASE_URL

# Test pg:promote - Promote a database to DATABASE_URL
# (Requires a follower or other database to promote)
./bin/run pg:promote --app $APP HEROKU_POSTGRESQL_FOLLOWER_URL

Related Issues

GitHub issue: #
GUS work item: W-19701144

@zwhitfield3 zwhitfield3 requested a review from a team as a code owner January 24, 2026 01:51
@zwhitfield3 zwhitfield3 changed the base branch from main to v11.0.0 January 24, 2026 01:52
@zwhitfield3 zwhitfield3 marked this pull request as draft January 24, 2026 01:56
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