Change record status: 
Project: 
Introduced in branch: 
main
Introduced in version: 
12.1.0
Description: 

The database query API now supports including a strict_params key in query options. This will change the behavior of conditions in queries so that comparisons use their native types rather than strings. This is required for comparing values in JSON database objects.

The Drupal\Core\Database\Query\Condition class now implements StrictSqlParamsConditionInterface, which is used by Select queries to determine if strict parameters is necessary query-wide. Please note that a query with at least one condition that uses the new Drupal\Core\Database\Query\JsonCondition will activate strict parameter binding for the query. When strict_params is active, parameters are no longer bound by the execute command using strings via PDO::PARAM_STR.

Example

TODO: put code doing a select with JsonCondition and Condition

TODO: put the SQL query string for that select here

Impacts: 
Module developers