right now functions like startswith() and endswith() rely upon an in-python string concatenation of "%" with the given value. this prevents the usage of bind parameters and other non-literal expressions. a better approach would be to move the string concatenation into the database layer, so that instead of producing:
where somecol LIKE "%foo"
we instead produce:
where somecol LIKE '%' + 'foo'
but not every database supports "+" as a concatenation operator. so a ConcatenationClause
would be needed which each dialect can produce as it likes, such as oracle which would produce CONCAT(x, y)
for example.
(original author: svil) mmh, i think u misunderstood this one: it's more for this use case:
table.select( table.c.somecol.endswith( bindparam(":foo") ))
or
table.select( table.c.somecol.endswith( literal(whatever) ))
IMO once the reverse-operators do work, this may just pass - IF the String type somehow reaches down to the sql-dialect and uses || where needed.