Mrs. Brisby wrote:

[...] I really would like to see user-defined "structures"- but I suspect this will have to wait for SQLite 3.0 or whenever we get non-null-terminating values...


You can do that now. The (experimental) sqlite_bind() API available in 2.8.7 allows you to insert arbitrary binary data into an SQLite database. There are, however, limitations:

  (1) When you do a query, you will get back a pointer to the
      beginning of the binary data, but not its length.  You'll
      probably need to store the length in a separate column.

  (2) The ".dump" command will only show the binary data through
      the first \000 character.  If the binary data contains no
      \000 characters, the ".dump" command might segfault.

  (3) If you try to put binary data into a column that is indexed,
      you will likely corrupt the database and may segfault.

Fixing (1) is not too hard, but there are non-technical reasons
that will delay this fix for at least 6 months. I have no clue
how to fix (2).  A fix for (3) will require a file format change.

Since you mentioned SQLite 3.0...  Design studies for SQLite 3.0
have been underway for several months.  We (I have collaborators)
are looking at a very different file format for 3.0 that is both
faster and uses less disk space.  The current thought is that the
API would change in several important ways too, ways that make it
easier to insert or extract binary data.  The new API routines would
use a prefix of "sqlite3_" instead of "sqlite_".  A small library
or wrapper routines (or perhaps macros) would be provided for
backwards compatibility to the SQLite 2.0 API.  Database files
would have to be converted separately in order to work with 3.0.
Bugs will continue to be fixed in the 2.x.x series after 3.0 appears,
in order to support legacy applications built around 2.x.x,
but new features will go into 3.0 exclusively, according to the
plan.  SQLite 3.0 is unlikely to appear before the middle of 2004
at the earliest.  There is no guarantee that SQLite 3.0 will ever
come into existance - we may decide to continue forward with 2.0
instead.
--
D. Richard Hipp -- [EMAIL PROTECTED] -- 704.948.4565


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to