Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
test: provide an ergonomic way to access the test database for debugging
  • Loading branch information
SasSwart committed Aug 15, 2025
commit 0890d844d3321fb9cad5f7e698dad8c13d4caf64
4 changes: 4 additions & 0 deletions coderd/database/dbtestutil/postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ func (p ConnectionParams) DSN() string {
return fmt.Sprintf("postgres://%s:%s@%s:%s/%s?sslmode=disable", p.Username, p.Password, p.Host, p.Port, p.DBName)
}

func WillLogDSN() bool {
return os.Getenv("CODER_TEST_LOG_PG_DSN") != ""
}

// These variables are global because all tests share them.
var (
connectionParamsInitOnce sync.Once
Expand Down