1
0
mirror of https://github.com/danog/postgres.git synced 2024-11-30 04:29:12 +01:00

Move PooledStatement to Internal namespace

This commit is contained in:
Aaron Piotrowski 2018-04-08 21:40:39 -05:00
parent 6e3f1ac40d
commit 9269fe5a96
No known key found for this signature in database
GPG Key ID: ADD1EF783EDE9EEB
3 changed files with 8 additions and 3 deletions

View File

@ -1,8 +1,11 @@
<?php
namespace Amp\Postgres;
namespace Amp\Postgres\Internal;
use Amp\Loop;
use Amp\Postgres\Operation;
use Amp\Postgres\Pool;
use Amp\Postgres\Statement;
use Amp\Promise;
use function Amp\call;

View File

@ -321,11 +321,13 @@ final class Pool implements Link {
/**
* {@inheritdoc}
*
* Prepared statements returned by this method will stay alive as long as the pool remains open.
*/
public function prepare(string $sql): Promise {
return call(function () use ($sql) {
$statement = yield from $this->doPrepare($sql);
return new PooledStatement($this, $statement, $this->prepare);
return new Internal\PooledStatement($this, $statement, $this->prepare);
});
}

View File

@ -6,7 +6,7 @@ use Amp\Delayed;
use Amp\Loop;
use Amp\PHPUnit\TestCase;
use Amp\Postgres\Pool;
use Amp\Postgres\PooledStatement;
use Amp\Postgres\Internal\PooledStatement;
use Amp\Postgres\ResultSet;
use Amp\Postgres\Statement;
use Amp\Success;