[英]peewee.OperationalError: no such function: json
Python version: 3.8.3 Python 版本:3.8.3
Peewee version: 3.13.3 Peewee 版本:3.13.3
I want to create an object which include a JSONField,我想创建一个包含 JSONField 的 object,
db = SqliteExtDatabase('../db.sqlite', pragmas=(('journal_mode', 'wal'), ('foreign_keys', 1)))
class Msg(BaseModel):
id = AutoField()
detail = JSONField()
def insert_msg(detail: dict):
msg = Msg.create(detail=detail)
msg.save()
but when I call the method insert_msg({"name":"abc"}) , an error comes out但是当我调用方法insert_msg({"name":"abc"})时,会出现错误
peewee.OperationalError: no such function: json
You need to have the sqlite json1 extension installed.您需要安装 sqlite json1 扩展。 Here are some links which may help:
以下是一些可能有帮助的链接:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.