Re: [sqlite] Database version

2017-07-22 Thread Stephen Chrzanowski
I have a routine that reads the first chunk of any file to see if it contains the SQLite header. That way I can be sure that what I'm opening is at least a SQLite database, I can skip on a Malformed Database error when trying to open a renamed BMP, and I have the security knowing that if files are

Re: [sqlite] Database version

2017-07-21 Thread Keith Medcalf
On Friday, 21 July, 2017 14:24, Igor Korot wrote: >I presume the same is true for the DB created with 3.0.0 and opened >with 3.20.0. >As long as I will use the standard SQL command and don't use any new >feature introduced in 3.20.0. >The only trouble is - I may not know in advance what version

Re: [sqlite] Database version

2017-07-21 Thread Igor Korot
Hi, Keith, On Fri, Jul 21, 2017 at 4:17 PM, Keith Medcalf 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 sim

Re: [sqlite] Database version

2017-07-21 Thread Keith Medcalf
>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. No, you are incorrect. If you open a DB file that w

Re: [sqlite] Database version

2017-07-21 Thread Jens Alfke
> On Jul 21, 2017, at 11:17 AM, Igor Korot 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 e

Re: [sqlite] Database version

2017-07-21 Thread Richard Hipp
On 7/21/17, Peter Da Silva wrote: > I assume BEGIN, COMMIT, and ROLLBACK are safe too :) Yes, of course. -- D. Richard Hipp d...@sqlite.org ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailm

Re: [sqlite] Database version

2017-07-21 Thread Peter Da Silva
I assume BEGIN, COMMIT, and ROLLBACK are safe too :) On 7/21/17, 1:08 PM, "sqlite-users on behalf of Richard Hipp" wrote: On 7/21/17, Simon Slavin wrote: > > The new features introduced by SQLite since it started using file format 3 > all require explicit commands to use. Add

Re: [sqlite] Database version

2017-07-21 Thread Igor Korot
Richard, et al, On Fri, Jul 21, 2017 at 2:08 PM, Richard Hipp wrote: > On 7/21/17, Simon Slavin wrote: >> >> The new features introduced by SQLite since it started using file format 3 >> all require explicit commands to use. Adding columns to existing tables, >> AUTOVACUUM mode, WAL journals, D

Re: [sqlite] Database version

2017-07-21 Thread Richard Hipp
On 7/21/17, Simon Slavin wrote: > > The new features introduced by SQLite since it started using file format 3 > all require explicit commands to use. Adding columns to existing tables, > AUTOVACUUM mode, WAL journals, DESC indexes, all require you to execute a > specific SQL command to use them.

Re: [sqlite] Database version

2017-07-21 Thread Simon Slavin
On 21 Jul 2017, at 6:42pm, Warren Young wrote: > Now to complicate that, macOS also ships a /usr/bin/sqlite3, which happens to > be 3.16.0 in macOS 10.12, so my superficial question is, can I safely open > *and modify* the Lightroom catalog file with the macOS version of SQLite, or > even so

Re: [sqlite] Database version

2017-07-21 Thread Warren Young
On Jul 21, 2017, at 10:11 AM, Jens Alfke wrote: > >> On Jul 21, 2017, at 8:25 AM, Igor Korot wrote: >> >> "Using SQLite library version X.Y.Z connecting to the DB version A.B.C" > > But why should your user care? As a developer I’ve been working with SQLite > since 2004 and I’ve never needed

Re: [sqlite] Database version

2017-07-21 Thread 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

Re: [sqlite] Database version

2017-07-21 Thread Jens Alfke
> On Jul 21, 2017, at 8:25 AM, Igor Korot wrote: > > In my "Help -> About..." I'd like to say something like: > > "Using SQLite library version X.Y.Z connecting to the DB version A.B.C" But why should your user care? As a developer I’ve been working with SQLite since 2004 and I’ve never neede

Re: [sqlite] Database version

2017-07-21 Thread Igor Korot
On Fri, Jul 21, 2017 at 11:55 AM, Peter Da Silva wrote: > If SQLite3 can open the file at all, the first 16 characters will be "SQLite > format 3\000". Or "SQLite format 4\000" soon. Or "SQLite format 3\000" for an ancient db file. Thank you. > > On 7/21/17, 10:46 AM, "sqlite-users on behalf o

Re: [sqlite] Database version

2017-07-21 Thread 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" wrote: Hi, Peter et al, On Fri, Jul 21, 2017 at 11:35 AM, Peter Da Silva wrote: > The problem is that SQLITE_VERSION_N

Re: [sqlite] Database version

2017-07-21 Thread Igor Korot
Hi, Peter et al, On Fri, Jul 21, 2017 at 11:35 AM, Peter Da Silva 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 a

Re: [sqlite] Database version

2017-07-21 Thread Peter Da Silva
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”. ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite

Re: [sqlite] Database version

2017-07-21 Thread Igor Korot
Hi, Bob, On Fri, Jul 21, 2017 at 11:27 AM, Bob Friesenhahn wrote: > On Fri, 21 Jul 2017, Igor Korot wrote: >> >> >> In my "Help -> About..." I'd like to say something like: >> >> "Using SQLite library version X.Y.Z connecting to the DB version A.B.C" > > > Is this a sensible expectation? Several

Re: [sqlite] Database version

2017-07-21 Thread Bob Friesenhahn
On Fri, 21 Jul 2017, Igor Korot wrote: In my "Help -> About..." I'd like to say something like: "Using SQLite library version X.Y.Z connecting to the DB version A.B.C" Is this a sensible expectation? Several programs may access the database at once, and all could be using a different sqlite

Re: [sqlite] Database version

2017-07-21 Thread Igor Korot
Hi, Andy, On Fri, Jul 21, 2017 at 11:19 AM, Andy Ling wrote: >>Let's say I made some database files 2 years ago. >>Now I want the current SQLite code to open them and performs some queries >>from the C interface. > > I would ask why do you care? Sqlite will read old databases without any > probl

Re: [sqlite] Database version

2017-07-21 Thread Peter Da Silva
On 7/21/17, 10:14 AM, "sqlite-users on behalf of Igor Korot" wrote: > This is also stored at offset 96 in the db file: > > https://www.sqlite.org/fileformat.html Is this the number I'm after? That’s the version of SQLite that most recently wrote to the file. The word befor

Re: [sqlite] Database version

2017-07-21 Thread Andy Ling
>Let's say I made some database files 2 years ago. >Now I want the current SQLite code to open them and performs some queries >from the C interface. I would ask why do you care? Sqlite will read old databases without any problem. What you may be interested in is what schema version and that's up

Re: [sqlite] Database version

2017-07-21 Thread Simon Slavin
On 21 Jul 2017, at 4:14pm, Igor Korot wrote: > > Let's say I made some database files 2 years ago. > Now I want the current SQLite code to open them and performs some queries > from the C interface. SQLite file format hasn’t changed in over 10 years. Your current code and current version of

Re: [sqlite] Database version

2017-07-21 Thread Igor Korot
Hi, Peter, On Fri, Jul 21, 2017 at 11:06 AM, Peter Da Silva wrote: > https://www.sqlite.org/c3ref/c_source_id.html Those are for the library. But... Let's say I made some database files 2 years ago. Now I want the current SQLite code to open them and performs some queries from the C interface.

Re: [sqlite] Database version

2017-07-21 Thread Peter Da Silva
https://www.sqlite.org/c3ref/c_source_id.html This is also stored at offset 96 in the db file: https://www.sqlite.org/fileformat.html I don’t think there’s a pragma for extracting it from within SQLite code. On 7/21/17, 9:58 AM, "sqlite-users on behalf of Igor Korot" wrote: Hi, ALL,

RE: [sqlite] Database Version 2 or 3, can you query for it?

2005-03-02 Thread Cariotoglou Mike
The only way is to query one of the exported functions (sqlite3_version or something like this). I agree, however, that it would be nice to have a version resource in the DLL. Also, If somebody would take the trouble to do it, I would very much appreciate it if a proper MsVC project file , with app

Re: [sqlite] Database Version 2 or 3, can you query for it?

2005-03-01 Thread Chris Schirlinger
> Is it possible to query the database to see if it's 2.x or 3.x, we need to > know if the rowid's are 32 or 64 bit and we don't know what version we > might be running on? You can check the DB file header. The first 16 characters are "SQLite format 3\000" if it is version 3+ Check out http://w