Hey guys,
As a part of a project that I'm working on, Iv'e created a SQLAlchemy statement builder using the ast (abstract syntax trees) library.
This constructor will parse strings that are valid python logical statements and will convert them to the appropriate SQLAlchemy objects.
For example:
The constructor will take a string of the following format and a list of models/modelbase in which the columns exist.
string_a = '(column_a == 2 or column_b == 3) or column_c in [1,2,3]'
and returns the SQLAlchemy objects that defines this logic and can be used in a query's where clause.
This was used to automate query building for a projects with thousands of different logics that where defined by the client.
I was just wondering if you think there is a place for something like that in SQLAlchemy or related projects.
Best regards,
Nir