On Sun, Sep 20, 2015 at 4:10 PM, Igor Tandetnik <igor at tandetnik.org> wrote:

> On 9/20/2015 9:55 AM, gwenn wrote:
>
>> If there is no way to know that the statement has been recompiled, I
>> guess that the column count should not be cached...
>>
>
> You could use sqlite3_prepare (no _v2), then you'd get an error on schema
> change. You would then re-prepare the statement and update your caches.


Could perhaps also use the change counter
https://www.sqlite.org/fileformat2.html#chngctr, if you're not using WAL
mode.
You'd get false positives I guess, since both DML and DDL changes would
increment it, and I'm not sure that's any different from checking the
column_count anyway, but just in case it's useful. --DD

Reply via email to