> On Jul 21, 2017, at 11:17 AM, Igor Korot <ikoro...@gmail.com> wrote: > > The only trouble is - how do I know what version were used. > My application may use some features that is available right now and > I want to use them because they are great. > But if I open the DB from the old version I will simply get an error.
Use ‘pragma user_version’ to store a version number of your own choosing. Increment the user number when you make changes to the schema, whether you’re using new SQLite features or just altering tables. Then when you open a database, check the user_version and decide whether you need to run some sort of schema migration (like an ALTER TABLE), or just fail because the database is incompatibly too old. And the same goes in reverse — if the user_version is greater than what you support, give up because it’s a database from “the future”. —Jens _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users