added support for casting in db where clauses