Skip to content

[NFR]: ADR bridge and DataMapper database source #16

Closed

Description

@niden

Summary

An ADR app uses Phalcon\DataMapper\Pdo\Connection, so the Database panel stays empty. Add an ADR bridge and feed DatabaseCollector from the DataMapper events.

The route, view and exceptions panels have their own issues: #45, #46 and #47

Current state

  • Connection does not fire db:beforeQuery or db:afterQuery..
  • Connection does fire dm:* events when it has an events manager (Phalcon\DataMapper\Pdo\Events). The before* and after* events for exec, perform and query carry the statement and the values.
  • Connection::getProfiler() returns a profiler that is off by default. This issue does not need it.

Proposed direction

  • Add an ADR bridge. The ADR service provider from [NFR]: Framework-neutral integration seam: boot and response injection without Mvc\Application #14 boots it.
  • The bridge attaches to dm:beforeExec, dm:afterExec, dm:beforePerform, dm:afterPerform, dm:beforeQuery and dm:afterQuery, and calls the DatabaseCollector methods from [NFR]: Add a direct push API to collectors #44.
  • Attach by event name, not by class constant. Versions before v5.19.0 do not have these events.
  • The application calls $connection->setEventsManager($manager). MVC apps already do this for their services (docs/index.md:226). Document this.
  • Update the requirements in docs/index.md:13. The Database panel in an ADR app needs Phalcon v5.19.0 or later, or Phalcon 6.

Notes

  • The before* events are cancelable, and a listener result of false cancels the operation. The bridge listeners must not return false.
  • A probe confirmed the data for exec and perform. Confirm the data for query in this issue.

Acceptance

  • In an ADR app, the Database panel shows real queries with bindings and timing.
  • The MVC database source is unchanged.
  • Tests pass with full coverage. phpcs and phpstan pass.

Depends on

Part of

#13

Activity

  1. self-assigned this
    on Jul 22, 2026
  2. added theissue type on Jul 22, 2026
  3. moved this from Backlog to Active Sprint in Phalcon v5on Oct 17, 2026
  4. changed the title [-][NFR]: Collector source adapters for ADR data sources (DB / View / Route)[/-] [+][NFR]: ADR bridge and DataMapper database source[/+] on Nov 3, 2026
  5. niden commented on Nov 4, 2026

    @niden
    SponsorMemberAuthor

    Resolved in #53

  6. moved this from Active Sprint to Implemented in Phalcon v5on Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

  • Status
    Implemented

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions