jprante/elasticsearch-river-jdbc — pull request #155 by psliwa (2013-12-21 18:08:51+00:00)
Title: Column strategy: placeholder for where clause

Column strategy modifies sql query in order to retrieve new, updated and deleted records. Additional conditions was appended to where clause in two ways:

* when ``WHERE`` keyword doesn't exist in sql, then on the end of query append ``WHERE ...extra conditions...``
* when ``WHERE`` keyword exists, then append additional conditions to this where clasue

There was a problem with queries with subqueries or without where clause and with limit/order by/group by clauses. So I have added third way of appending extra conditions to where clause:

* when ``$where`` placeholder exists, then this placeholder will be replaced by extra conditions.

Example:

SELECT id, name FROM products WHERE $where

``$where`` will be replaced by extra conditions, so possible subqueries won't be broken. There is no BC, previous two ways still works when ``$where`` placeholder is missing.

Related pull request: #137