Re: [sqlite] Binary compatibility

2006-06-02 Thread Nikki Locke
Kurt Welgehausen wrote:
> Nikki Locke <[EMAIL PROTECTED]> wrote: 
> > 
> > Given that I am using SQLite.Net, if I execute this pragma as the first 
> > command 
> > passed over the connection, before creating any tables, will it work? Or do 
> > I 
> > really have to execute it "before creating the database"? 
>  
> I think you're confusing creating the database with creating the 
> file. When you open a non-existent db file, your file system is 
> probably creating a file of zero size; the database hasn't been 
> initialized yet. You can easily verify this by looking at the 
> file size after you open() the db but before you do anything else. 

Thanks. I've done the test you suggested, and the file is indeed of zero length 
until the first table is created (at which point I assume the database is 
created as 
well).

-- 
Nikki Locke, Trumphurst Ltd.  PC & Unix consultancy & programming
http://www.trumphurst.com/




Re: [sqlite] Binary compatibility

2006-06-01 Thread Kurt Welgehausen
Nikki Locke <[EMAIL PROTECTED]> wrote:
>
> Given that I am using SQLite.Net, if I execute this pragma as the first 
> command
> passed over the connection, before creating any tables, will it work? Or do I
> really have to execute it "before creating the database"?

I think you're confusing creating the database with creating the
file. When you open a non-existent db file, your file system is
probably creating a file of zero size; the database hasn't been
initialized yet. You can easily verify this by looking at the
file size after you open() the db but before you do anything else.

Regards


Re: [sqlite] Binary compatibility

2006-06-01 Thread Nikki Locke
D. Richard Hipp wrote:
> 3.2.2 will refuse to read a database file created by 3.3.5 
> unless version 3.3.5 was compiled with -DSQLITE_DEFAULT_FILE_FORMAT=1 
> or the "PRAGMA legacy_file_format=ON" pragma is used prior to creating 
> the database.  But if the database is created in a way that 3.2.2 
> can read it, there should be no incompatibilities between 3.3.5 
> and 3.2.2 (or any other SQLite version, for that matter).  Anything 
> created by version 3.2.2 should always be readable by 3.3.5, regardless.

Google can't find this pragma documented anywhere at sqlite.org.

Given that I am using SQLite.Net, if I execute this pragma as the first command 
passed over the connection, before creating any tables, will it work? Or do I 
really have to execute it "before creating the database"?

-- 
Nikki Locke, Trumphurst Ltd.  PC & Unix consultancy & programming
http://www.trumphurst.com/




Re: [sqlite] Binary compatibility

2006-05-31 Thread drh
Dennis Jenkins <[EMAIL PROTECTED]> wrote:
> 
> I have recently updated my development branch from v 3.2.1 to v 3.3.5
> and noticed the compatibility issue as well.  What are the key
> differences between the two file formats?  Is there a compelling reason
> to move to the new format (vs using the pragma and keeping the old format)?
> 

The new file format stores boolean values more efficiently.
So if you have a lot of entries in your database with a value
of 0 or 1, your database file might be noticably smaller.

Making the enhanced file format the default in 3.3.0 has
caused a lot of people a lot of grief.  I understand now
that I probably should have made it an option that could
be turned on by people who wanted it, rather than the default
that can be turned off by those who do not.  But that's 
now water under the bridge

--
D. Richard Hipp   <[EMAIL PROTECTED]>



Re: [sqlite] Binary compatibility

2006-05-31 Thread Dennis Jenkins
[EMAIL PROTECTED] wrote:
> Nikki Locke <[EMAIL PROTECTED]> wrote:
>   
>
> 3.2.2 will refuse to read a database file created by 3.3.5
> unless version 3.3.5 was compiled with -DSQLITE_DEFAULT_FILE_FORMAT=1
> or the "PRAGMA legacy_file_format=ON" pragma is used prior to creating
> the database.  But if the database is created in a way that 3.2.2
> can read it, there should be no incompatibilities between 3.3.5
> and 3.2.2 (or any other SQLite version, for that matter).  Anything
> created by version 3.2.2 should always be readable by 3.3.5, regardless.
>
> --
> D. Richard Hipp   <[EMAIL PROTECTED]>
>
>   


I have recently updated my development branch from v 3.2.1 to v 3.3.5
and noticed the compatibility issue as well.  What are the key
differences between the two file formats?  Is there a compelling reason
to move to the new format (vs using the pragma and keeping the old format)?



Re: [sqlite] Binary compatibility

2006-05-31 Thread drh
Nikki Locke <[EMAIL PROTECTED]> wrote:
> I am running sqlite 3.3.5 on Microsoft Windows, and sqlite 3.2.2 on CentOS 
> (because that's the version that comes with CentOS).
> 
> Should the data files produced by these two versions be binary compatible? 
> I.e. can I transfer the db files between the two machines and continue to 
> use them with the two different sqlite3 versions?
> 
> I ask because I think I have occasionally seen records "disappear" when 
> looking at a 3.2.2 data file using 3.3.5.
> 
> If they are not binary compatible, I presume I will have to downgrade the 
> Windows version to 3.2.2, as I expect upgrading the CentOS one will break 
> all the other CentOS applications which are already using databases in 
> 3.2.2 format.
> 
> If the two versions are supposed to be binary compatible, could it be 
> something to do with a Windows/Linux difference?
> 
> If there shouldn't be any incompatilibity, I will put some effort into 
> reproducing the problem, and reporting it through the usual channels.

3.2.2 will refuse to read a database file created by 3.3.5
unless version 3.3.5 was compiled with -DSQLITE_DEFAULT_FILE_FORMAT=1
or the "PRAGMA legacy_file_format=ON" pragma is used prior to creating
the database.  But if the database is created in a way that 3.2.2
can read it, there should be no incompatibilities between 3.3.5
and 3.2.2 (or any other SQLite version, for that matter).  Anything
created by version 3.2.2 should always be readable by 3.3.5, regardless.

--
D. Richard Hipp   <[EMAIL PROTECTED]>