DatabaseObserverInterface
interface DatabaseObserverInterface (View source)
Receives individual database timings and original bindings, without results or exception details.
SQL and binding values are unredacted: implementations must sanitize them before retaining or displaying anything. An observer failure disables notifications for the remaining capture without affecting SQL totals.
Methods
Receives one prepare/bind/execute attempt, excluding connection open and subsequent fetching.
Receives a connection-open/session-setup attempt separately from query counts and SQL time.
Details
queryCompleted
void
queryCompleted(string $sql, float $durationMs, bool $successful, array $bindings = [], DatabaseDialect|null $dialect = null)
Receives one prepare/bind/execute attempt, excluding connection open and subsequent fetching.
Successful means the operation returned normally; failed attempts are included in SQL totals.
connectionCompleted
void
connectionCompleted(float $durationMs, bool $successful)
Receives a connection-open/session-setup attempt separately from query counts and SQL time.