File tree Expand file tree Collapse file tree 1 file changed +0
-30
lines changed
Expand file tree Collapse file tree 1 file changed +0
-30
lines changed Original file line number Diff line number Diff line change @@ -18,40 +18,10 @@ class Pool extends Adapter
1818
1919 /**
2020 * @param UtopiaPool<covariant Adapter> $pool The pool to use for connections. Must contain instances of Adapter.
21- * @throws DatabaseException
2221 */
2322 public function __construct (UtopiaPool $ pool )
2423 {
2524 $ this ->pool = $ pool ;
26-
27- $ this ->pool ->use (function (mixed $ resource ) {
28- if (!($ resource instanceof Adapter)) {
29- throw new DatabaseException ('Pool must contain instances of ' . Adapter::class);
30- }
31-
32- // Run setters in case the pooled adapter has its own config
33- try {
34- $ this ->setAuthorization ($ resource ->getAuthorization ());
35- } catch (\Error $ e ) {
36- // Authorization not initialized yet, so skip it.
37- }
38- $ this ->setDatabase ($ resource ->getDatabase ());
39- $ this ->setNamespace ($ resource ->getNamespace ());
40- $ this ->setSharedTables ($ resource ->getSharedTables ());
41- $ this ->setTenant ($ resource ->getTenant ());
42-
43- if ($ resource ->getTimeout () > 0 ) {
44- $ this ->setTimeout ($ resource ->getTimeout ());
45- }
46- $ this ->resetDebug ();
47- foreach ($ resource ->getDebug () as $ key => $ value ) {
48- $ this ->setDebug ($ key , $ value );
49- }
50- $ this ->resetMetadata ();
51- foreach ($ resource ->getMetadata () as $ key => $ value ) {
52- $ this ->setMetadata ($ key , $ value );
53- }
54- });
5525 }
5626
5727 /**
You can’t perform that action at this time.
0 commit comments