Use .any():
session.query(Gizmo).filter(Gizmo.users.any('user1'))
On Wednesday, October 13, 2021 at 11:50:16 PM UTC+10 chat...@gmail.com
wrote:
> Imagine a Postgres JSON column with values like below:
> "["user1", "user2"]"
>
> Is there any way to query a postgres JSON (not JSONB) column
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