How can I use UUIDs in SQLAlchemy?

后端 未结 8 1004
心在旅途
心在旅途 2020-12-07 10:58

Is there a way to define a column (primary key) as a UUID in SQLAlchemy if using PostgreSQL (Postgres)?

8条回答
  •  半阙折子戏
    2020-12-07 11:54

    I've used the UUIDType from the SQLAlchemy-Utils package: http://sqlalchemy-utils.readthedocs.org/en/latest/data_types.html#module-sqlalchemy_utils.types.uuid

提交回复
热议问题