How to make a case sensitive entity query? My custom entity type comes with a string field for which I would prefer case sensitive queries. When I use
$query = \Drupal::entityQuery('my_entity_type')
 -&gt;condition('my_token_field', 'SomeSortofTokenString')
 -&gt;execute();

the result will include all entities no matter if the string in my_token_field is written the same way or for example with lowercases only. my_token_field is set a base field of type string - maybe this is the problem?
Like you already said, I think you should set case_sensitive to true in the field settings, like here. This can also be set in the config.
When digging in the code, I found that the condition function at some point leads to translateCondition which checks if a field is case sensitive and automatically applies the binary option to the sql query.