Skip to content

Commit 1ca8176

Browse files
committed
Diag: attach logger to driver's internal connection
1 parent 2a1e9d6 commit 1ca8176

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

.github/workflows/phpunit-tests-doltlite.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,9 @@ jobs:
185185
$pdo = new $pdo_class("sqlite::memory:");
186186
$conn = new WP_SQLite_Connection(["pdo" => $pdo]);
187187
$driver = new WP_SQLite_Driver($conn, "wp");
188-
// The driver replaces the logger in its constructor; set a new one
189-
// that prints every query live so we see where it crashes.
190-
$conn->set_query_logger(function (string $sql, array $params) {
188+
// The driver creates its own internal connection; attach the
189+
// trace logger to THAT connection so we see every query.
190+
$driver->get_connection()->set_query_logger(function (string $sql, array $params) {
191191
$short = substr(str_replace("\n", " ", preg_replace("/\s+/", " ", trim($sql))), 0, 250);
192192
fwrite(STDOUT, sprintf("[SQL] %s\n", $short));
193193
});

0 commit comments

Comments
 (0)