Skip to content

Commit 5aa5d34

Browse files
mcraveiroclaude
andcommitted
Document SQLGEN_TEST_PASSWORD in test helpers
Add doc comments explaining that SQLGEN_TEST_PASSWORD environment variable can be set to override the default password for tests. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 267459e commit 5aa5d34

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

tests/mysql/test_helpers.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66

77
namespace sqlgen::mysql::test {
88

9+
/// Creates test credentials for MySQL.
10+
/// Set SQLGEN_TEST_PASSWORD environment variable to override the default
11+
/// password ("password"). This allows running tests against an existing
12+
/// database without modifying source code.
913
inline Credentials make_credentials() {
1014
const char* env_password = std::getenv("SQLGEN_TEST_PASSWORD");
1115
return Credentials{.host = "localhost",

tests/postgres/test_helpers.hpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,12 @@
66

77
namespace sqlgen::postgres::test {
88

9+
/// Creates test credentials for PostgreSQL.
10+
/// Set SQLGEN_TEST_PASSWORD environment variable to override the default
11+
/// password ("password"). This allows running tests against an existing
12+
/// database without modifying source code.
913
inline Credentials make_credentials() {
10-
const char* env_password = std::getenv("PGPASSWORD");
14+
const char* env_password = std::getenv("SQLGEN_TEST_PASSWORD");
1115
return Credentials{.user = "postgres",
1216
.password = env_password ? env_password : "password",
1317
.host = "localhost",

0 commit comments

Comments
 (0)