How can I convert a sql where clause string to a sqlalchemy query? I'm assuming I already know the table.
I'm building an Angular webapp which hits a Flask API for data. Flask is using sqlalchemy to query the db. jQuery-QueryBuilder fromSQL (http://querybuilder.js.org/plugins.html#import-export) exports filters as raw SQL which I want to pass back to the api, parse, and query.
For example:
where_str = "name LIKE '%BOB%' AND fruit != 'pineapple'"
would get converted to:
session.query(Table).filter(Table.name.like('%BOB%')).filter(Table.fruit != 'pineapple)
Tagging blaze because odo might be what I need.