Hi Stephan Ben and all,
by the way: checking the column count only applies to SQLite. Other
databases (Postgres, Oracle) support the insert into returning or
update ... returning syntax, resulting in statements that change the
database and have columns at the same time.
This is a feature I
On Thu, Aug 6, 2015 at 6:57 PM, Ben Newberg wrote:
> Excellent. This is exactly what I was looking for.
>
Great :). Now that i have some code in front of me i can say, more
concretely, that sqlite3_column_count() is what you want.
https://www.sqlite.org/c3ref/column_count.html
--
- stepha
On Thu, Aug 6, 2015 at 6:46 PM, Ben Newberg 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 updat
> users-bounces at mailinglists.sqlite.org] On Behalf Of Scott Hess wrote on
> Thursday, August 06, 2015 1:11 PM
>
> Also consider https://www.sqlite.org/c3ref/stmt_readonly.html
>
> On Thu, Aug 6, 2015 at 10:08 AM, Stephan Beal
> wrote:
>
> > On Thu, Aug 6, 2015 at 6:57 PM, Ben Newberg
> wro
Excellent. This is exactly what I was looking for.
Thanks.
On Thu, Aug 6, 2015 at 11:50 AM, Stephan Beal wrote:
> On Thu, Aug 6, 2015 at 6:46 PM, Ben Newberg wrote:
>
> > Is there a good way to determine if a sql query is either attempting to
> > modify a database, or simply querying it?
> >
>
Is there a good way to determine if a sql query is either attempting to
modify a database, or simply querying it?
In the past, I have used sqlite3_update_hook with good results, but in this
current project, I am looking for a way to determine the type of query even
before the prepared statement is
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On 08/06/2015 09:46 AM, Ben Newberg wrote:
> Is there a good way to determine if a sql query is either
> attempting to modify a database, or simply querying it?
You most like want to use the authoriser. It tells you exactly what
the query is doing, a
Also consider https://www.sqlite.org/c3ref/stmt_readonly.html
-scott
On Thu, Aug 6, 2015 at 10:08 AM, Stephan Beal wrote:
> On Thu, Aug 6, 2015 at 6:57 PM, Ben Newberg wrote:
>
> > Excellent. This is exactly what I was looking for.
> >
>
> Great :). Now that i have some code in front of me i c
8 matches
Mail list logo