peewee.OperationalError: no such function: json

Viewed 978

Python version: 3.8.3

Peewee version: 3.13.3

I want to create an object which include a JSONField,

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

peewee.OperationalError: no such function: json
1 Answers
Related