Re: [sqlite] Distinguish type of statements

2019-03-19 Thread Simon Slavin
On 19 Mar 2019, at 8:53pm, siscia  wrote:

> Do you think it would be possible to add a function that does what I need?

No.  I've not part of the development team but I think it's quite complicated.  
Also, the fact that there's already a function which does what you want makes 
it unlikely there'll be another one.

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


Re: [sqlite] Distinguish type of statements

2019-03-19 Thread siscia
Hi Simon,

Thanks! Indeed I thought about a similar solution but it seems a little
contrived.

Do you think it would be possible to add a function that does what I need?
How is the design coordinated? Where should I post my RFC?

Cheers,
Simone



--
Sent from: http://sqlite.1065341.n5.nabble.com/
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Distinguish type of statements

2019-03-19 Thread Simon Slavin
On 19 Mar 2019, at 6:40pm, siscia  wrote:

> Given a statement, is there any way to know if it is an UPDATE, DELETE, 
> INSERT, SELECT or something else?

It's not simple but if you are actually trying to execute that statement, you 
can register an authorizer function.



The function you specify is passed a parameter which is one of



so you could pick out SQLITE_SELECT, SQLITE_INSERT, SQLITE_UPDATE, 
SQLITE_DELETE, and ignore the others.  Or something like it.  Your routine 
returns either SQLITE_OK or SQLITE_DENY depending on whether you want the 
operation to continue.

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


[sqlite] Distinguish type of statements

2019-03-19 Thread siscia
Hi All,

I am already afraid that the answer to the question will be "no", but it
will save a lot of development effort on my side, so is worth to ask.

Given a statement, is there any way to know if it is an UPDATE, DELETE,
INSERT, SELECT or something else?

Thanks,
Simone



--
Sent from: http://sqlite.1065341.n5.nabble.com/
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users