Open
Description
Telescope Version
5.2.6
Laravel Version
11.5
PHP Version
8.3
Database Driver & Version
Postgres 17
Description
The SQL displayed on the Query Details page is incorrect when using whereJsonContainsKey
with Postgres. This might be due to the fact that Postgres uses ??
in the query.
Eg. if I use ->whereJsonContainsKey('metadata->preferences->notifications')
and check $query->toSql()
I see coalesce(("metadata"->'preferences')::jsonb ?? 'notifications', false)
, which is correct.
But in Telescope, the ??
is randomly replaced with values from other parts of the query:
The real SQL and query are correct. The problem is just with what Telescope is displaying.
Steps To Reproduce
Execute a query using whereJsonContainsKey
and Postgres 17 and check the details in the Telescope dashboard.