Skip to content

Commit

Permalink
Add transaction isolation param
Browse files Browse the repository at this point in the history
  • Loading branch information
trowski committed Oct 11, 2024
1 parent 04c8bbd commit 94a2465
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/PostgresConnectionPool.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
use Amp\Sql\SqlResult;
use Amp\Sql\SqlStatement;
use Amp\Sql\SqlTransaction;
use Amp\Sql\SqlTransactionIsolation;
use Amp\Sql\SqlTransactionIsolationLevel;
use function Amp\async;

/**
Expand All @@ -33,8 +35,15 @@ public function __construct(
int $idleTimeout = self::DEFAULT_IDLE_TIMEOUT,
private readonly bool $resetConnections = true,
?SqlConnector $connector = null,
SqlTransactionIsolation $transactionIsolation = SqlTransactionIsolationLevel::Committed,
) {
parent::__construct($config, $connector ?? postgresConnector(), $maxConnections, $idleTimeout);
parent::__construct(
config: $config,
connector: $connector ?? postgresConnector(),
maxConnections: $maxConnections,
idleTimeout: $idleTimeout,
transactionIsolation: $transactionIsolation,
);
}

/**
Expand Down

0 comments on commit 94a2465

Please sign in to comment.