On 9 Jul 2018, at 10:21pm, Thomas Kurz <sqlite.2...@t-net.ruhr> wrote:

> However, this is a bit confusing as e.g. this works fine:
> 
> CREATE TABLE test (col1 TEXT UNIQUE ON CONFLICT IGNORE);

There is actually a way to do what you want.  You do it with a TRIGGER which 
does the test and drops the offending row using RAISE (IGNORE) .

<https://sqlite.org/lang_createtrigger.html>

However, this may be horribly confusing to anyone else who has to understand 
your programming.  They may be trying to insert a row and magically nothing 
happens.  It may be better to have the IGNORE command in the INSERT command 
that they will be looking at rather than in a part of the schema they may not 
be thinking about.

On the other hand, it might better suit the way your software works.

Simon.
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to