Is EntityFieldQuery as sophisticated as the Database API? I was wondering if EntityFieldQuery is just a layer of abstraction on top of the database query builder. For example can I use addExpression and isNotNull in an EntityFieldQuery, for example?

Or, is it separate and not as sophisticated.
I was wondering if EntityFieldQuery is just a layer of abstraction on top of the database query builder.


Yes, that's exactly what it is. It's not subclass of SelectQuery or anything higher up the chain, though.


  For example can I use addExpression and isNotNull in an EntityFieldQuery, for example?


No, EFQ doesn't implement those methods. You can see what methods are available by looking at the source.


  Or, is it separate and not as sophisticated.


Yes it's separate, "not as sophisticated" can't really apply since the functional differences between EFQ and a SelectQuery are intentional. They're not supposed to do the same thing, an EFQ is intentionally limited to functionality that makes sense for entities only.

However, an EFQ will eventually run a SelectQuery anyway, which you can alter just like any other query. So you can make it as "sophisticated" as you need to.