From 78e20a166081ca6d81e16fc39554fe5c8536d1fe Mon Sep 17 00:00:00 2001 From: nixx Date: Fri, 7 Nov 2025 17:23:58 +0300 Subject: [PATCH 1/2] support postgres config options --- src/PostgresConfig.php | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/PostgresConfig.php b/src/PostgresConfig.php index 7d5243b..eeeefad 100644 --- a/src/PostgresConfig.php +++ b/src/PostgresConfig.php @@ -22,6 +22,7 @@ final class PostgresConfig extends SqlConfig 'ssl_mode' => 'sslmode', 'sslMode' => 'sslmode', 'applicationName' => 'application_name', + 'options' => 'options', ]; private ?string $connectionString = null; @@ -42,6 +43,7 @@ public static function fromString(string $connectionString): self $parts["db"] ?? null, $parts["application_name"] ?? null, $parts["sslmode"] ?? null, + $parts["options"] ?? null, ); } @@ -53,6 +55,7 @@ public function __construct( ?string $database = null, private ?string $applicationName = null, private ?string $sslMode = null, + private ?string $options = null, ) { self::assertValidSslMode($sslMode); @@ -115,6 +118,25 @@ public function withoutApplicationName(): self return $new; } + public function getOptions(): ?string + { + return $this->options; + } + + public function withOptions(string $options): self + { + $new = clone $this; + $new->options = $options; + return $new; + } + + public function withoutOptions(): self + { + $new = clone $this; + $new->options = null; + return $new; + } + /** * @return string Connection string used with ext-pgsql and pecl-pq. */ @@ -152,6 +174,10 @@ public function getConnectionString(): string $chunks[] = \sprintf("application_name='%s'", \addslashes($this->applicationName)); } + if ($this->options !== null) { + $chunks[] = \sprintf("options='%s'", \addslashes($this->options)); + } + return $this->connectionString = \implode(" ", $chunks); } } From 32aaa314ef24bccc7fa9f203110be7c864818869 Mon Sep 17 00:00:00 2001 From: nixx Date: Fri, 7 Nov 2025 17:28:01 +0300 Subject: [PATCH 2/2] update ci cache version --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c7a614f..66177ca 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -48,7 +48,7 @@ jobs: run: echo "::set-output name=dir::$(composer config cache-dir)" - name: Cache dependencies - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ${{ steps.composer-cache.outputs.dir }} key: composer-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('**/composer.*') }}-${{ matrix.composer-flags }}