Re: SQLite API deficiency

From: Date: Thu, 13 May 2004 13:46:05 +0000
Subject: Re: SQLite API deficiency
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-9835@lists.php.net to get a copy of this message
On May 13, 2004 09:25 am, Stanislav Malyshev wrote: > I have discovered that SQLite function sqlite_query runs sqlite_exec > function if it's return value is used and sqlite_compile/sqlite_step combo > if return value is used. I think this is a problem - if I want to run some > pack of queries (like, create whole DB schema in one call), I can do it > with sqlite_query - but only if I don't check the return value - and thus > don't know if it succeeded or not! If I check the return value, it runs > sqlite_compile/sqlite_step, which can not run multiple SQL statements. You could always check the status of the query by running the sqlite_last_error(). > I think this should be fixed. In order not to break BC, I propose to add > new function to SQLite API - sqlite_exec, which - surprise! - would always > call sqlite_exec and would return only true/false. Good idea. > Though, the even better > solution would be to kill that return_value_used check altogether and use > two separate functions always, depending on the task. I'd prefer to have sqlite_exec() like you propose and leave sqlite_query() as is. Ilia

« previous php.internals (#9835) next »