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

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

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

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

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

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

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

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

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

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

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

Re: [sqlite] Database version

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

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

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,

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

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

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

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

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

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

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?

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

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

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"

[sqlite] Database version

2017-07-21 Thread Igor Korot
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. ___

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

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

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

2005-03-01 Thread mike . griffin
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?