Skip to content

Commit 68f5f07

Browse files
committed
comment
1 parent 495222c commit 68f5f07

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

coderd/database/dbtestutil/postgres.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ func (p ConnectionParams) DSN() string {
4040
return fmt.Sprintf("postgres://%s:%s@%s:%s/%s?sslmode=disable", p.Username, p.Password, p.Host, p.Port, p.DBName)
4141
}
4242

43+
// WillLogDSN returns true if the DSN should be shown during testing.
44+
// Set the CODER_TEST_LOG_PG_DSN environment variable to show the DSN.
45+
// This provides an ergonomic way to connect to test databases during
46+
// debugging without the need to spin up postgres manually.
4347
func WillLogDSN() bool {
4448
return os.Getenv("CODER_TEST_LOG_PG_DSN") != ""
4549
}

0 commit comments

Comments
 (0)