On 3 Nov 2005, at 13:18, [EMAIL PROTECTED] wrote:

Another proposal:  Suppose that when creating an
sqlite3_stmt using sqlite3_prepare, the original SQL
text was stored in the sqlite3_stmt.

I'm in favour of this change. I think any code that wraps around prepared/reusable queries will have to do it anyway (I've written code to do exactly this).

Based on some of the previous comments (and my limited understanding of SQLite internals), it would seem to make sense to limit this functionality to cases when the developer specifically is preparing a query for reuse. Perhaps a new prepare function, where the only difference between it and the current one is that the original statement is stored and re-preapared as needed. Wrappers creating reusable queries would just call the new function and be guaranteed not to get a SQLITE_SCHEMA error, whereas existing code will work as before.

This originally came up for me when ATTACHing and detaching a database changed the schema. In my application this is not a "rare case".

Cheers,

Demitri

Reply via email to