尽管存在主键,但 SQLite 未检测到 table 上的唯一键

Sqlite does not detect unique key on a table despite primary key being present

我正在尝试从 sqlite 数据库中删除一条记录。我使用 dbeaver 程序进行所有操作。因此,当执行操作时,会显示以下错误:

错误说唯一键不存在。 table 创建的查询是这样的:

CREATE TABLE betGroups ( 
id INTEGER PRIMARY KEY AUTOINCREMENT, 
betgroupstatus INTEGER NOT NULL,
dateInserted DATETIME DEFAULT CURRENT_TIMESTAMP)

但是,如果我们检查唯一键选项卡 - 我们将看到存在一个唯一键:

所以基本上,primary key 被认为是 unique key。尽管如此,仍然显示错误。

对于我收到此错误的原因,是否有一个很好的解释?我尝试为 id 字段添加 UNIQUE 关键字。 table 已创建,但没有任何区别。我是否可以在程序选项或 SQL 脚本中更改任何其他内容以使错误消失。

我不确定这是我的脚本问题、驱动程序问题还是程序问题。

使用:

它最终成为 DBeaver 中的缺陷。引用:

https://github.com/dbeaver/dbeaver/issues/6337

This is side effect of the #424 fix. Currently DBeaver doesn't use unique keys with nullable columns. I believe we should use them in SQLite at least.