CHECK and ON CONFLICT
(1) By anonymous on 2021-07-13 00:13:57 [source]
In https://www.sqlite.org/lang_conflict.html it says:
The ON CONFLICT clause applies to [...] CHECK constraints.
However on the diagram table-constraint https://www.sqlite.org/lang_createtable.html#syntax the CHECK constraint is not followed by a conflict-clause.
Check test case:
sqlite> create table test(id int check(id > 0) on conflict ignore);
Error: near "on": syntax error
Primary key test case:
sqlite> create table test(id int PRIMARY KEY on conflict ignore);
sqlite> insert into test(id) values (0);
sqlite> insert into test(id) values (0);
sqlite> select * from test;
0
Am I misunderstanding the documentation, or is the documentation wrong?
Thank you in advance for your help.
David
(2) By Keith Medcalf (kmedcalf) on 2021-07-13 00:38:06 in reply to 1 [link] [source]
That ON CONFLICT clause is referring to the statement handling of internal conflicts. That is:
INSERT ON CONFLICT IGNORE INTO
(3) By anonymous on 2021-07-13 04:20:26 in reply to 2 [link] [source]
I ended up pre-processing my data with Python.
Thank you Keith, I really appreciate you taking the time to answer my question.
David