0
我想,以配合我已經在我的PostgreSQL數據庫的名稱一些名字,使用下面的代碼:如何在postgresql數組字段上使用ilike sqlalchemy?
last_like = '{last_name}%'.format(last_name)
matches = Session.query(MyTable).filter(or_(
MyTable.name.ilike(last_like),
MyTable.other_names.any(last_like, operator=ilike_op),
)).all()
本質上,它試圖name列或匹配任何存儲其他的名字作爲other_names列中的數組。
,但我得到:
KeyError: <function ilike_op at 0x7fb5269e2500>
我在做什麼錯?