On 10/18/2014 01:07 AM, dave wrote:
I have a virtual table implementation, and I would like to use the INSERT OR
REPLACE syntax to simplify actions for the user.  In my xUpdate method, for
the case where insertion is occuring,

else if ( argc > 1 && SQLITE_NULL == sqlite3_value_type ( argv[0] ) ) {

I do check a uniqueness constraint, and return an error
SQLITE_CONSTRAINT_UNIQUE, which I presume is the right thing to do.
So, my question is, is this the right thing to do to get INSERT OR REPLACE
on a virtual table, or something else, or maybe that syntax is not supported
on virtual tables?

I don't think so. See the final paragraph here:

  http://sqlite.org/c3ref/c_vtab_constraint_support.html

Looks like you have to implement the "OR REPLACE" support in the xUpdate method.

Dan.



Thanks, -dave
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

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

Reply via email to