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
Prev Previous commit
Next Next commit
use a functional option instead
  • Loading branch information
SasSwart committed Aug 15, 2025
commit 96f0b376e7ba14085fd2649e5a230c3553f420cb
8 changes: 0 additions & 8 deletions coderd/database/dbtestutil/postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,6 @@ 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)
}

// WillLogDSN returns true if the DSN should be shown during testing.
// Set the CODER_TEST_LOG_PG_DSN environment variable to show the DSN.
// This provides an ergonomic way to connect to test databases during
// debugging without the need to spin up postgres manually.
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