On Thu, 24 Nov 2011 08:45:12 -0500, Dilip Ranganathan
<[email protected]> wrote:

> Currently I use sqlite to create a bunch of on-disk tables to store my
> data. I use Sqlite's master table to determine if a table already exists
> based on which I take certain decisions.
>
> Suppose I switch these to in-memory tables (:memory:), how do I go about
> checking if a table exists? Do in-memory tables still get an entry in the
> master table?

Yes.

> If not, how else should I go about with this?

when you connect to the in-memory database you can be sure none of the
tables exist because an in memory database is not persistent.

> thanks!
>
> P.S: I know that one can simply do a CREATE TABLE IF NOT EXISTS... but I
> still need to know if a table exists or not.

You can easily try this with the sqlite3 command line tool by omitting
the database file name argument on the command line.
Create a table, insert a row, check sqlite_master.

-- 
Regards,

Kees Nuyt

_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to