ashvinmb / sqljet

Automatically exported from code.google.com/p/sqljet
0 stars 0 forks source link

Document file format usage #56

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
There is an option - file format.

What file formats are supported?
When it could be changed?
How this corresponds with native client versions?

We should document it and write corresponding tests.

Original issue reported on code.google.com by dimzzy@gmail.com on 7 Jul 2009 at 9:22

GoogleCodeExporter commented 9 years ago
Schema layer file-format. If SQLJet encounters a database with a schema layer
file-format value greater than the file-format that it understands (currently 
4),
then SQLJet will refuse to access the database.

If any of the following file-format features are used, then the schema layer
file-format must be set to the corresponding value or greater:

   2. Implicit NULL values at the end of table records.
   3. Implicit default (non-NULL) values at the end of table records.
   4. Descending indexes and Boolean values in database records. 

Original comment by sergey.s...@gmail.com on 9 Jul 2009 at 1:00

GoogleCodeExporter commented 9 years ago
PRAGMA legacy_file_format;
PRAGMA legacy_file_format = boolean

This pragma sets or queries the value of the legacy_file_format flag. When this 
flag
is on, new SQLJet databases are created in a file format that is readable and
writable by all versions of SQLite going back to 3.0.0. When the flag is off, 
new
databases are created using the latest file format which might not be readable 
or
writable by versions of SQLite prior to 3.3.0.

When the pragma is issued with no argument, it returns the setting of the flag. 
This
pragma does not tell which file format the current database is using. It tells 
what
format will be used by any newly created databases.

This flag only affects newly created databases. It has no effect on databases 
that
already exist.

The default file format is set by the SQLJET_DEFAULT_FILE_FORMAT and
SQLJET_LEGACY_FILE_FORMAT system properties.

Original comment by sergey.s...@gmail.com on 9 Jul 2009 at 1:02

GoogleCodeExporter commented 9 years ago
SQLJET_DEFAULT_FILE_FORMAT=<1 or 4>

    The default schema-level file format used by SQLJet when creating new database
files is set by this macro. The file formats are all very similar. The 
difference
between formats 1 and 4 is that format 4 understands descending indices and has 
a
tighter encoding for boolean values.

    SQLite (as of version 3.6.0) can read and write any file format between 1 and 4.
But older versions of SQLite might not be able to read formats greater than 1. 
So
that older versions of SQLite will be able to read and write database files 
created
by newer versions of SQLite, the default file format is set to 1 for maximum
compatibility.

Original comment by sergey.s...@gmail.com on 9 Jul 2009 at 1:05

GoogleCodeExporter commented 9 years ago
There are draft descriptions of "file format" values and "legacy_file_format" 
pragma
which are derived from SQLite documentation. 

Support of file formats in Btree layer is implemented, but we have lack of
implementation for next features:

  * "legacy_file_format" pragma
  * Implicit default (non-NULL) values for file format 3.
  * Boolean values for file format 4.

I've add system property SQLJET_LEGACY_FILE_FORMAT which defines default value 
for
"legacy_file_format" and by default it has value "true".

Manual direct change of file format value through API possible only for new 
empty
databases and should be performed without using of transaction.

Original comment by sergey.s...@gmail.com on 9 Jul 2009 at 1:26

GoogleCodeExporter commented 9 years ago
After implementation of lacking features ("legacy_file_format" pragma, implicit
default (non-NULL) values, boolean values ) we should add these and additional
descriptions for each feature into wiki.

Original comment by sergey.s...@gmail.com on 9 Jul 2009 at 1:30

GoogleCodeExporter commented 9 years ago

Original comment by sergey.s...@gmail.com on 17 Sep 2009 at 9:50

GoogleCodeExporter commented 9 years ago

Original comment by sergey.s...@gmail.com on 17 Sep 2009 at 9:51