Skip to content

Queries need a real database connection since v3.14.0 #1778

Closed
@cweiske

Description

@cweiske

My application collects data not only from MariaDB, but also from ElasticSearch, Drupal (via GraphQL), Microsoft Dynamics CRM and Microsoft PowerAutomate.
Debugbar's query logs are incredible helpful, so I integrated all the adapters into Debugbar's "queries" tab by logging queries by dispatching \Illuminate\Database\Events\QueryExecuted objects. I only needed a small dummy connection class that returned the database and driver names for that to work:
Image


Now I'm upgrading from Laravel 8 to 9, and with it laravel-debugbar from v3.7.0 to v3.14.10, and I am seeing javascript errors in the debugbar code:

data.statements is undefined

The reason is that an exception happens during debugbar processing:

Debugbar exception: Database connection [graphql] not configured.

While previously the connection's name was simply taken from $query['connection'] in QueryCollector::collect(), it asks Laravel's DatabaseManager for the connection and gets its name from there since commit ed37d1a.

This requires me to configure and register the connection within laravel's database management code, which is pretty complex.

I'd like to see that the code is changed, so that the connection name is taken from the connection object that's provided by the query.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions