赞
踩
在使用SQLAlchemy查询MySQL的JSON字段时,你可以按照以下步骤操作:
假设你有一个名为 items
的表格,其中有一个名为 data
的JSON字段。我们来查询这个字段。
首先,你需要定义一个与表格对应的模型类。例如:
from sqlalchemy import create_engine, Column, Integer, String, JSON
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base(<
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。