[sqlalchemy] SqlAlchemy with Postgres: How can I make a query that checks if a string is in a list inside a json column

2021-10-13 Thread chat...@gmail.com
Imagine a Postgres JSON column with values like below: "["user1", "user2"]" Is there any way to query a postgres JSON (not JSONB) column with SqlAlchemy,like above that checks if the value "user1" is contained in this column? -- SQLAlchemy - The Python SQL Toolkit and Object Relational

[sqlalchemy] Using SQLAlchemy to check if column is in numeric ranges

2021-08-31 Thread chat...@gmail.com
Hello All!! , I have a list of age ranges i.e 18-25, 40-55 and more how can I make make a query using *SQLAlchemy* that will check if a Column is in ranges [18,25] OR [40-55] OR [60-70] Regards,Christos -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper

[sqlalchemy] SQLAlchemy MYSQL query utf8 character problem

2020-09-03 Thread chat...@gmail.com
Trying to query all items from a mysql (charset:utf8) table which has a field that contains rows with chinese and other special characters I am taking the above error items = session.query(Item).all() File