laravel-debugbar icon indicating copy to clipboard operation
laravel-debugbar copied to clipboard

Support for Read-Only PDO in QueryCollector

Open iamacarpet opened this issue 3 years ago • 2 comments

Hello,

We've run into a few problems using Debugbar on our project as it is configured read-only.

To ensure there are no development mistakes, the read connection is configured with a live DB instance and the write connection is configured with invalid details, so it'll throw an error if anyone tries to write to the DB.

Debugbar appears to be trying to use the write connection rather than read, with read being Laravel's default for SELECT statements (and it would also be fine for EXPLAIN SELECT).

Would you consider replicating Laravel's default behaviour with this change to use the read PDO when nothing other than SELECTs are being used?

Regards, iamacarpet

iamacarpet avatar Nov 29 '22 10:11 iamacarpet

@barryvdh we are still seeing this problem on Laravel 11.x with the latest version of debug bar.

Any chance you'd consider merging this please?

iamacarpet avatar May 09 '24 12:05 iamacarpet

@barryvdh Same issue. Could you check this mr?

CheesyTech avatar Jul 25 '24 10:07 CheesyTech