[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sqlite-users
Subject:    Re: [sqlite] sqlite3_open: detecting creation vs opening
From:       "Roger Binns" <rogerb () rogerbinns ! com>
Date:       2004-12-28 4:58:26
Message-ID: 007c01c4ec99$ddb318f0$3501a8c0 () rogersqyvr14d3
[Download RAW message or body]

> I know that I can check for the existance of the database file - but I
> was hoping to avoid that particular hoop.

That isn't necessarily as easy as you think.  Unless you took great
care to ensure that all characters in the pathname are ascii then it
could be quite difficult to know exactly what series of bytes SQLite
used to open the file with.

You can do the query "select count(*) from sqlite_master".  You'll
get back zero if there are no tables, indices or any other data
structures.  Of course that is indistinguishable from having a
huge database and then dropping all the tables.

Roger
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic