Problem/Motivation
Suppose that in a source plugin, extending from SqlBase
, you want to override SqlBase::prepareQuery()
and use that to add additional tags or meta-data to the query. You don't do that in ::query()
method for some good reasons (for example you want to apply tags & meta-data only after the query was defined). If a hook_query_TAG_alter()
that uses those tags adds a new condition then SqlBase::count()
is lying.
For this reason, this is a blocker for #3069776: [PP-1]: SQL source plugins: allow defining conditions and join in migration yml, which introduces some query modifications in ::prepareQuery()
method.
Proposed resolution
Make SqlBase::count()
aware of SqlBase::prepareQuery()
.
Remaining tasks
Review / commit.
There are no User interface, API, or data model changes.