Skip to content

Commit 20feeaf

Browse files
committed
wip
1 parent c511dd7 commit 20feeaf

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

packages/database/src/Config/PostgresConfig.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,10 @@ final class PostgresConfig implements DatabaseConfig
1313
{
1414
public string $dsn {
1515
get => sprintf(
16-
'pgsql:host=%s;port=%s;dbname=%s;user=%s;password=%s',
16+
'pgsql:host=%s;port=%s;dbname=%s',
1717
$this->host,
1818
$this->port,
1919
$this->database,
20-
$this->username,
21-
$this->password,
2220
);
2321
}
2422

@@ -34,7 +32,7 @@ public function __construct(
3432
#[SensitiveParameter]
3533
public string $username = 'postgres',
3634
#[SensitiveParameter]
37-
public string $password = '',
35+
public ?string $password = null,
3836
#[SensitiveParameter]
3937
public string $database = 'app',
4038
public NamingStrategy $namingStrategy = new PluralizedSnakeCaseStrategy(),

packages/database/src/Connection/PDOConnection.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,10 @@ public function connect(): void
9898
return;
9999
}
100100

101-
$this->pdo = new PDO($this->config->dsn);
101+
$this->pdo = new PDO(
102+
dsn: $this->config->dsn,
103+
username: $this->config->username,
104+
password: $this->config->password,
105+
);
102106
}
103107
}

0 commit comments

Comments
 (0)