![](/img/trans.png)
[英]How to create a table with Interval as primary key in SQLAlchemy?
[英]how to create a Storm table with no primary key?
我正在嘗試使用Storm創建到現有MySQL數據庫的ORM。 我正在嘗試為其中一個表創建表類,但出現此錯誤:
storm.exceptions.ClassInfoError: <class 'statsstorm.Aggframe'> has no primary key information
該表沒有主鍵,也沒有產生唯一行的列的任何組合。 它的功能更像日志。
如何創建沒有主鍵的Storm表類?
class Aggframe(Storm):
""" Storm-based interface to the stats.aggframe table."""
__storm_table__ = 'aggframe'
user = Unicode()
dept = Unicode()
frame_avg = Float()
我不建議您創建沒有PK的表。
如果有的話,在該表中添加一個IDENTITY列並用作PK。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.