[EMAIL PROTECTED] wrote:
* 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.
I actually prefer the existing behaviour. If you do start returning the
error code, then what happens to the underlying statement? Is it reset
or finalized? That is important distinction since the former can have
bindings transferred and the latter not. Also the connection can be
closed if the latter happens but not the former. ie reset or finalize is
going to have be called anyway to get the statement into a known state.
sqlite3_prepare_ex1
I would just go with sqlite_prepare_ex as it is a common practise and
will also be sequential in the doc as Robert pointed out.
QUESTION 2: Are there any other API warts that need to be
worked around that can be fixed by this same change?
http://article.gmane.org/gmane.comp.db.sqlite.general/9222
Unicode:
I guess that depends where you want the burden of byte order and
UTF-32/16/8 conversion. Currently they are pushed into the wrapper.
That is ok by me or could be put in SQLite with an additional API.
SQLITE_TRANSIENT:
Currently only takes a pointer to a free() function. Would be more
useful if it can also take a void* as well since I need to call the free
function on a container object, not the char* passed in.
Duplicate code:
An API addition in 3.3.7 removed one of the duplicate code cases.
Another remains.
Replacing registered functions:
Currently it is hard to do garbage collection on function and
collation names because I can't tell if they have been replaced. eg if
function "Foo" is registered and then later function "fOo" is
registered, how does the wrapper know the first one can be freed? And
since UTF8 is used for the API, I can't even begin to guess what case
conversion rules are in use. At the moment I restrict the names to pure
alpha-numeric and upper case them. That way I can tell in my own list
of registered function/collation names if it is overwriting an existing
name.
Constant names/values:
I'd love these to be non-overlapping and uniquely prefixed.
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?
I think it should return whatever would have happened anyway. Users
should not have to know or care about when particular operations happen
under the hood. Their statement references a table that doesn't exist
which is an error. The fact that it did exist 50ms ago when the prepare
API was originally called is immaterial.
Roger
-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------