entityFIeldQuery on user table, how can I add a condition for $user->data I have tried extending EntitiyFieldQuery to add a condition that would be able to match on a $user-&gt;data["somevar"], but to no avail. I am not sure this is even possible, as  $user-&gt;data is serialised. 

I have just the base class working, returing users with status set to 1:

class SubscriberEntityFieldQuery extends EntityFieldQuery {
  // define some defaults for the class
  public function __construct() {
    // now we don't need to define these over and over anymore
    $this
      -&gt;entityCondition('entity_type', 'user')
      -&gt;propertyCondition('status', 1);
  }
}


Would anyone have an idea if this is even possible? Or would I need to resort to using db_query for a case like this?
The data column contains a serialized PHP string, which MySQL doesn't understand. As far as MySQL is concerned the data is just a string like any other.

Because of that you won't be able to query the properties of the serialized objects in that column without doing some seriously nasty work with SUBSTRING/regex/insert-other-unreliable-method-here.

If possible you should add a field to the user entity instead that represents the same data, and use the EntityFieldQuery with that field. It might not be ideal but it's probably the easiest solution.