On Aug 1, 2018, at 1:52 PM, Tim Streater <t...@clothears.org.uk> wrote:
> 
> I don't use the pragma since, officially, they are unsupported.

“Unsupported” how?  It’s documented and part of the SQLite file header, which 
is quite stable.

If you mean this is not standard SQL and thus doesn’t work on non-SQLite DBs, 
then just do what we do, since we didn’t start out on SQLite: keep the schema 
version number in a separate file.  You probably have some kind of preference 
file, or INI file, or registry key, or whatever associated with this software.  
Put it there if you don’t want to give it to SQLite to manage.

> But I'd rather have the IF NOT EXISTS.

That sounds wasteful.  99+% of the time, the column will exist, because it was 
created the first time the program was run after being upgraded.  Imagine how 
many redundant SQL statements you’ll have to run on program startup a dozen 
years hence when you have maybe a hundred schema changes.

I’ll stick by my advice: this is an upgrade-time operation only.  After the 
software’s been successfully upgraded, the schema is stable and implicitly 
trustworthy, always.
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to