https://www.sqlite.org/lang_createtable.html#rowid
“ If an INSERT statement attempts to insert a NULL value into a rowid or integer primary key column, the system chooses an integer value to use as the rowid automatically. A detailed description of how this is done is provided separately.”
我表示有点难以接受这个“ feature ”,如果是 int 且 pk 情况下,无论你是否允许 null 输入,都会成功 insert,而且当年 null 输入时,自增 id ( Autoincrement )且无论你是否设置开启了自增功能。
折腾了我一晚上,大家觉得这是一个合理 feature 么?
“ If an INSERT statement attempts to insert a NULL value into a rowid or integer primary key column, the system chooses an integer value to use as the rowid automatically. A detailed description of how this is done is provided separately.”
我表示有点难以接受这个“ feature ”,如果是 int 且 pk 情况下,无论你是否允许 null 输入,都会成功 insert,而且当年 null 输入时,自增 id ( Autoincrement )且无论你是否设置开启了自增功能。
折腾了我一晚上,大家觉得这是一个合理 feature 么?
2 条回复 • 2019-02-06 17:58:40 +08:00
|
1
wd 2019 年 2 月 6 日 via iPhone
这其实没什么好吐槽的,各种软件多少都会有一些开发者觉得合理的设定,你有你的道理,他们有他们的,学习掌握就好了,没办法。实在不服气自己改代码做自己想做的
|