| 263 | Base = cls.DeclarativeBasic |
| 264 | |
| 265 | class json_property(index_property): |
| 266 | def __init__(self, attr_name, index, cast_type): |
| 267 | super().__init__(attr_name, index) |
| 268 | self.cast_type = cast_type |
| 269 | |
| 270 | def expr(self, model): |
| 271 | expr = super().expr(model) |
| 272 | return expr.astext.cast(self.cast_type) |
| 273 | |
| 274 | class Json(ComparableEntity, Base): |
| 275 | __tablename__ = "json" |