Regular expressions in SQLalchemy queries?

前端 未结 3 1508
旧时难觅i
旧时难觅i 2020-12-29 20:56

Is it possible to use a regex in a way similar to session.query(MyObject).filter_by(REGEX)?

If not, how can I use sqlAlchemy to retrieve records that ha

3条回答
  •  灰色年华
    2020-12-29 21:49

    I think I got it:

    session.query(Object).filter(Object.column.op('regexp')(REGEX))
    

提交回复
热议问题