On Thu, 2005-04-21 at 18:18 -0700, Vladimir Vukicevic wrote: > On 4/21/05, D. Richard Hipp <[EMAIL PROTECTED]> wrote: > > So when the schema changes, it is not a matter of changes > > a few bits and pieces of the VM. The VM must be completely > > reconstructed. Its a complete do-over. > > Yep, I guess what I'm suggesting is just doing that reconstruction > internally to SQLite, and preserving the currently-bound parameters in > the process since the statement will still have the same number of > parameters before/after the schema change. Even if it's not done > completely transparently, perhaps a sqlite3_statement_status() that > returns the same error code that sqlite3_finalize() does, and then a > sqlite3_reprepare() or _reconstruct() that does essentially finalize() > and prepare(), but preserves any bound parameters on the statement? >
How about sqlite3_transfer_bindings(). So if you get an SQLITE_SCHEMA error you rerun sqlite3_prepare() to get a new sqlite3_stmt, then call sqlite3_transfer_bindings() to transfer bindings from the old statement over to the new statement. Then sqlite3_finalize() the old statement. -- D. Richard Hipp <[EMAIL PROTECTED]>