Skip to content

Commit 3ecdfbc

Browse files
committed
Added QueryLogger to log the execution of queries
1 parent 5d6e61e commit 3ecdfbc

File tree

3 files changed

+17
-5
lines changed

3 files changed

+17
-5
lines changed

src/Builder/QueryStatement.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,4 +75,19 @@ public function fetchColumn($columnNo = 0) {
7575
public function closeCursor() {
7676
return $this->statement->closeCursor();
7777
}
78+
79+
/**
80+
* @return int
81+
*/
82+
public function columnCount() {
83+
return $this->statement->columnCount();
84+
}
85+
86+
/**
87+
* @param int $columnNo
88+
* @return array
89+
*/
90+
public function getColumnMeta($columnNo) {
91+
return $this->statement->getColumnMeta($columnNo);
92+
}
7893
}

src/Builder/RunnableSelect.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ public function getFoundRows() {
161161
}
162162

163163
/**
164-
* @return \PDOStatement
164+
* @return QueryStatement
165165
*/
166166
private function createStatement() {
167167
$db = $this->db();
@@ -175,7 +175,7 @@ private function createStatement() {
175175
}
176176

177177
/**
178-
* @param \PDOStatement $statement
178+
* @param QueryStatement $statement
179179
* @return array
180180
*/
181181
private function getFieldTypes($statement) {

src/Databases/MySQL.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,10 @@
44
use Kir\MySQL\Builder;
55
use Kir\MySQL\Builder\Exception;
66
use Kir\MySQL\Builder\QueryStatement;
7-
use Kir\MySQL\Builder\Statement;
87
use Kir\MySQL\Database;
98
use Kir\MySQL\QueryLogger\QueryLoggers;
109
use Kir\MySQL\Tools\AliasRegistry;
11-
use Kir\MySQL\Tools\PDOStatementInterceptor;
1210
use PDO;
13-
use PDOStatement;
1411
use UnexpectedValueException;
1512
use Kir\MySQL\Builder\RunnableSelect;
1613

0 commit comments

Comments
 (0)