1
我不斷收到關於primary_key=True
的以下錯誤。請有人指出我出錯的地方。我試圖遵循:SQL鍊金術:表primary_key - 意外的關鍵字參數錯誤
http://docs.sqlalchemy.org/en/latest/core/metadata.html#metadata-describing
from sqlalchemy import *
mydata123 = table("dailymarketdata", metadata,
column('data_id', mysql.BIGINT, primary_key=True),
column('dt', Date),
column('security_id', mysql.VARCHAR),
column('open', float),
column('high', float),
column('low', float),
column('close', float),
column('ma200', float),
column('rtrend', mysql.TINYINT))
TypeError Traceback (most recent call last)
<ipython-input-350-bd385371a391> in <module>()
2
3 mydata123 = table("dailymarketdata", metadata,
----> 4 column('data_id', mysql.BIGINT, primary_key=True),
5 column('dt', Date),
6 column('security_id', mysql.VARCHAR),
TypeError: column() got an unexpected keyword argument 'primary_key'
如果我排除primary_key=True
我得到另一個錯誤
`AttributeError: 'MetaData' object has no attribute 'key'