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

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.

void
void
connectionCompleted(float $durationMs, bool $successful)

Receives a connection-open/session-setup attempt separately from query counts and SQL time.

void

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.

Parameters

string $sql
float $durationMs
bool $successful
array $bindings
DatabaseDialect|null $dialect

Return Value

void

connectionCompleted

void connectionCompleted(float $durationMs, bool $successful)

Receives a connection-open/session-setup attempt separately from query counts and SQL time.

Parameters

float $durationMs
bool $successful

Return Value

void