Using whereJsonContainsKey
with Postgres breaks SQL formatting on Query Details page
#1556
Labels
whereJsonContainsKey
with Postgres breaks SQL formatting on Query Details page
#1556
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 seecoalesce(("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.The text was updated successfully, but these errors were encountered: