Creating JSON type Column in SQLite with sqlalchemy

后端 未结 3 1216
日久生厌
日久生厌 2020-12-06 06:53

Is it possible to create JSON type Column in SQLite with sqlalchemy? I\'ve tried

import sqlalchemy.types as types
...
myColumn = Column(types.JSON())
         


        
3条回答
  •  半阙折子戏
    2020-12-06 07:17

    SQLAlchemy 1.3 will include support for SQLite JSON extension, so don't forget to upgrade:

    pip install --user -U --pre SQLAlchemy
    

    The dialect specific type sqlite.JSON implements JSON member access, usable through the base type types.JSON as well.

提交回复
热议问题