I don't think storm can do that for you. The method to determine existing
tables differs from database to database. For instance in SQLlite it is
SELECT name FROM sqlite_master WHERE type='table'
and in Firebird
SELECT RDB$RELATION_NAME as name
  FROM RDB$RELATIONS
 WHERE RDB$SYSTEM_FLAG=0
   AND RDB$VIEW_BLR IS NULL;

I always look at the source of php project adodb that does have database
introspection.

~Gerdus

On Thu, Aug 14, 2008 at 8:26 AM, Alexei Vinidiktov <
[EMAIL PROTECTED]> wrote:

> Hello,
>
> How do I check when creating an instance of a class bound to a
> database whether the 1. underlying database and 2. the tables already
> exist (were created previously)?
>
> IIRC, in SQLAlchemy when creating tables you can write something like this:
>
> self.words.create(checkfirst=True)
> self.meanings.create(checkfirst=True)
> self.examples.create(checkfirst=True)
>
> Which creates the tables only if they don't exist.
>
> Storm doesn't have table generators so I wouldn't know what to do.
>
> Thanks.
>
> --
> Alexei Vinidiktov
>
> --
> storm mailing list
> [email protected]
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/storm
>
-- 
storm mailing list
[email protected]
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/storm

Reply via email to