Sounds great, it would certainly clean up a lot of my code :) 

1: How about sqlite3_prepare_statement()
2: Not really, most of my suggestions will be for virtual table error
handling 
3: I vote for SQLITE_SCHEMA.

Thanks!

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, November 07, 2006 8:18 AM
To: sqlite-users@sqlite.org
Subject: [sqlite] Q about new SQLite API

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]
----------------------------------------------------------------------------
-


-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to