Re: Database version

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Database version

Peter da Silva
If SQLite3 can open the file at all, the first 16 characters will be "SQLite format 3\000".

On 7/21/17, 10:46 AM, "sqlite-users on behalf of Igor Korot" <[hidden email] on behalf of [hidden email]> wrote:

    Hi, Peter et al,
   
    On Fri, Jul 21, 2017 at 11:35 AM, Peter Da Silva
    <[hidden email]> wrote:
    > The problem is that SQLITE_VERSION_NUMBER is not “the database version”, it’s something like “the last version of SQLite that committed a transaction”.
    >
    > The database version number is “3”.
   
    I guess it is not stored anywhere.
   
    That's OK. I will just read and parse first 16 characters of the file...
   
    Thank you.
   
    >
    >
    > _______________________________________________
    > sqlite-users mailing list
    > [hidden email]
    > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
    _______________________________________________
    sqlite-users mailing list
    [hidden email]
    http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
   

_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Database version

David Raymond
There's nothing in the file itself apart from the schema format number of 1-4.

If you want to get a "version valid for" sort of thing you'd have to scan http://www.sqlite.org/changes.html for non-backwards compatible features, then scan the schema in sqlite_master for those.

For example...
-If you see a partial index you would know 3.8.0+
-"without rowid" you could say the database needed version 3.8.2+
-Index on an expression: 3.9.0+

You'd also have to look for things in triggers, views etc like row values (3.15.0+) etc.

It'd probably be a pain to implement. If you try to open a database with a feature from the future you get some sort of "not a database" error, or something.


-----Original Message-----
From: sqlite-users [mailto:[hidden email]] On Behalf Of Igor Korot
Sent: Friday, July 21, 2017 10:57 AM
To: Discussion of SQLite Database
Subject: [sqlite] Database version

 Hi, ALL,
Is there a way to know the version of the .db file I am using?

I'd like to issue some kind of SELECT statement to get it.

Looks like there is an interface to get the library version, but I don't
see anything for a db file.

Thank you.
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Loading...