我有一个 python 脚本,可以执行一些简单的 SQL。
c.execute("CREATE TABLE IF NOT EXISTS simpletable (id integer PRIMARY KEY, post_body text, post_id text, comment_id text, url text);")
command = "INSERT OR IGNORE INTO simpletable VALUES ('%s', '%s', '%s', '%s')" % (comments[-1].post_body, comments[-1].post_id, comments[-1].comment_id,
comments[-1].url)
c.execute(command)
c.commit()
Run Code Online (Sandbox Code Playgroud)
但是当我执行它时,我收到错误
sqlite3.OperationalError:表 simpletable 有 5 列,但提供了 4 个值
为什么它不自动填写密钥id?