我想知道是否有机会column_property
使用 dogpile 进行缓存。
这是我的代码:
A.some_count = column_property(
select([func.count()])
.where(and_(B.__table__.c.a_id == A.__table__.c.id,
B.__table__.c.c_id == C.__table__.c.id))
.correlate(A.__table__, C.__table__)
.as_scalar()
.label('some_count'),
deferred=True)
有人知道该怎么做吗?任何类型的缓存都可以使用时间戳或无效。
谢谢你的帮助。