SQLAlchemy's ORM ilike Queries Do Not Preserve String Casing on Results

HomePython

SQLAlchemy with Posgresql generates an unexpected result when using ilike ORM queries.... The strings that are returned on the fields which "ilike" queries are performed are returned in all lowercase despite being stored in the database with varied casing.

I tried reproducing this using a simple ORM model but didn't get the unexpected result. Seems like this issue arises only when doing joins or related objects as well.

Written by
Alex Luis Arias