Petr Vanek <[EMAIL PROTECTED]> wrote:
> I have to perform an additional check for example by a dummy
> select statement to be sure it is a db.
> 

Correct.  SQLite defers opening and looking at the database file
for as long as it can.  This allows you to issue pragma to set
up your connection.

For example, when creating a new database file, you can do

    PRAGMA auto_vacuum=1;
    PRAGMA page_size=4096;

And so forth.  These parameters cannot be changed after the file
is created.  They have to be specified beforehand.  Hence it is
important for SQLite to not open and read the database file until
it really needs to.

Even for preexisting files this is important.  Consider the
(proprietary) SQLite Encryption Extension.  You enter the
encryption key using a pragma:

    PRAGMA key=x'012345678';

Obviously, you will not be successful and opening and judging
the validity of the database file without the key, hence it is
important to defer reading the database file.


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


-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to