Re: [sqlite] INSERT OR REPLACE in a virtual table implementation....

2014-10-17 Thread dave
...
> 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,
> >
...
> > 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! That's news I can use; don't know how I missed that article, but
maybe because I was busy coding...

-dave


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


Re: [sqlite] INSERT OR REPLACE in a virtual table implementation....

2014-10-17 Thread Dan Kennedy

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


[sqlite] INSERT OR REPLACE in a virtual table implementation....

2014-10-17 Thread dave
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?
 
Thanks,
 
-dave
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users