Sqlalchemy core in clause

This article is tagged with: Sqlalchemy core in clause and mysql

sqlalchemy core in clause

session.execute(
select(
[MyUserTable.c.id, MyUserTable.c.name],
MyUserTable.c.id.in_((123, 456))
)
).fetchall()

sqlalchemy _in array sqlite

session.query(MyUserClass).filter(MyUserClass.id.in_((123,456))).all()

This article is tagged with: Sqlalchemy core in clause and mysql