[EMAIL PROTECTED] wrote:
I'm working on a new API routine for SQLite and I have
questions for the community.
The working name of the new api is sqlite3_prepare_v2().
sqlite3_prepare_v2() works like sqlite3_prepare() in that
it generates a prepared statement in an sqlite3_stmt
structure. The differences is in the behavior of the
resulting sqlite3_stmt and in particular a difference in
the way sqlite3_step() responds to the sqlite3_stmt. The
differences are these:
* You never get an SQLITE_SCHEMA error. sqlite3_prepare_v2
retains the original SQL and automatically reprepares and
rebinds it following a schema change.
* sqlite3_step() returns the correct error code right
away, rather than just returning SQLITE_ERROR and making
you call sqlite3_reset() to find the true reason for the
error.
In this way, I am hoping that sqlite3_prepare_v2() will work
around two of the most visible warts in the current API.
QUESTION 1: sqlite3_prepare_v2 is the merely the working name
for the new function. What should the official name be?
Some possibilities include:
sqlite3_prepare_ex1
sqlite3_prepare_ng
sqlite3_new_prepare
sqlite3_compile
QUESTION 2: Are there any other API warts that need to be
worked around that can be fixed by this same change?
QUESTION 3: Suppose there is a schema change and the SQL
statement is automatically reprepared. But the schema change
is such that the SQL is no longer valid. (Perhaps one of the
tables mentioned in a SELECT statement was dropped.) What
error code should sqlite3_step() return in that case?
--
D. Richard Hipp <[EMAIL PROTECTED]>
-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------
Nice change.
1. sqlite3_compile More descriptive of what is happening
2. ...
3. SQL_COMPILE_ERROR To unambiguousloy indicate the the SQL is now
wrong and won't compile.
-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------