diff --git a/src/Database/Adapter/Pool.php b/src/Database/Adapter/Pool.php index 632ac620d..71d59c98a 100644 --- a/src/Database/Adapter/Pool.php +++ b/src/Database/Adapter/Pool.php @@ -18,40 +18,10 @@ class Pool extends Adapter /** * @param UtopiaPool $pool The pool to use for connections. Must contain instances of Adapter. - * @throws DatabaseException */ public function __construct(UtopiaPool $pool) { $this->pool = $pool; - - $this->pool->use(function (mixed $resource) { - if (!($resource instanceof Adapter)) { - throw new DatabaseException('Pool must contain instances of ' . Adapter::class); - } - - // Run setters in case the pooled adapter has its own config - try { - $this->setAuthorization($resource->getAuthorization()); - } catch (\Error $e) { - // Authorization not initialized yet, so skip it. - } - $this->setDatabase($resource->getDatabase()); - $this->setNamespace($resource->getNamespace()); - $this->setSharedTables($resource->getSharedTables()); - $this->setTenant($resource->getTenant()); - - if ($resource->getTimeout() > 0) { - $this->setTimeout($resource->getTimeout()); - } - $this->resetDebug(); - foreach ($resource->getDebug() as $key => $value) { - $this->setDebug($key, $value); - } - $this->resetMetadata(); - foreach ($resource->getMetadata() as $key => $value) { - $this->setMetadata($key, $value); - } - }); } /**