Excellent. This is exactly what I was looking for. Thanks.
On Thu, Aug 6, 2015 at 11:50 AM, Stephan Beal <sgbeal at googlemail.com> wrote: > On Thu, Aug 6, 2015 at 6:46 PM, Ben Newberg <ben.newberg at gmail.com> wrote: > > > Is there a good way to determine if a sql query is either attempting to > > modify a database, or simply querying it? > > > > Check the column count of the prepared statement: it will be >0 for a > select or select-like pragma. Anything else is an update, delete, drop, > create table/view, non-select-like pragma, or similar. > > -- > ----- stephan beal > http://wanderinghorse.net/home/stephan/ > http://gplus.to/sgbeal > "Freedom is sloppy. But since tyranny's the only guaranteed byproduct of > those who insist on a perfect world, freedom will have to do." -- Bigby > Wolf > _______________________________________________ > sqlite-users mailing list > sqlite-users at mailinglists.sqlite.org > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users >