1111 */
1212namespace Hyperf \Database \PgSQL ;
1313
14+ use Exception ;
15+ use Generator ;
1416use Hyperf \Database \Connection ;
1517use Hyperf \Database \Exception \QueryException ;
1618use Hyperf \Database \PgSQL \Concerns \PostgreSqlSwooleExtManagesTransactions ;
@@ -107,7 +109,7 @@ public function select(string $query, array $bindings = [], bool $useReadPdo = t
107109 $ result = $ statement ->execute ($ this ->prepareBindings ($ bindings ));
108110
109111 if ($ result === false || ! empty ($ this ->pdo ->error )) {
110- throw new QueryException ($ query , [], new \ Exception ($ this ->pdo ->error ));
112+ throw new QueryException ($ query , [], new Exception ($ this ->pdo ->error ));
111113 }
112114
113115 return $ statement ->fetchAll ($ this ->fetchMode ) ?: [];
@@ -117,7 +119,7 @@ public function select(string $query, array $bindings = [], bool $useReadPdo = t
117119 /**
118120 * Run a select statement against the database and returns a generator.
119121 */
120- public function cursor (string $ query , array $ bindings = [], bool $ useReadPdo = true ): \ Generator
122+ public function cursor (string $ query , array $ bindings = [], bool $ useReadPdo = true ): Generator
121123 {
122124 $ statement = $ this ->run ($ query , $ bindings , function ($ query , $ bindings ) use ($ useReadPdo ) {
123125 if ($ this ->pretending ()) {
@@ -151,7 +153,7 @@ public function queryAll(string $query, array $bindings = []): array
151153
152154 $ result = $ statement ->execute ($ bindings );
153155 if (! $ result ) {
154- throw new QueryException ($ query , [], new \ Exception ($ this ->pdo ->error ));
156+ throw new QueryException ($ query , [], new Exception ($ this ->pdo ->error ));
155157 }
156158
157159 return $ statement ->fetchAll (SW_PGSQL_ASSOC );
@@ -212,7 +214,7 @@ protected function prepare(string $query): PostgreSQLStatement
212214
213215 $ statement = $ this ->pdo ->prepare ($ query );
214216 if (! $ statement ) {
215- throw new QueryException ($ query , [], new \ Exception ($ this ->pdo ->error ));
217+ throw new QueryException ($ query , [], new Exception ($ this ->pdo ->error ));
216218 }
217219
218220 return $ statement ;
0 commit comments