Re: [Sqlalchemy-users] two questions

2005-12-16 Thread limodou
2005/12/17, Michael Bayer <[EMAIL PROTECTED]>: > > On Dec 15, 2005, at 7:41 PM, limodou wrote: > > > > I think if I can test the table exist as: > > > > if not table.name in sqlite_engine.tables: > > table.create() > > > > This code is ok? > > I'v tried again, If I didn't define the table meta

Re: [Sqlalchemy-users] two questions

2005-12-16 Thread Michael Bayer
On Dec 15, 2005, at 7:41 PM, limodou wrote: I think if I can test the table exist as: if not table.name in sqlite_engine.tables: table.create() This code is ok? well that doesnt do any kind of SQL to actually ask the database for a table. I think what would happen now if a table d

Re: [Sqlalchemy-users] two questions

2005-12-15 Thread Michael Bayer
On Dec 14, 2005, at 7:59 PM, limodou wrote: 1. Is there a easy way to detect a table has exist? , you might try saying t = new Table('mytable', engine, autoload=True) and catch an exception. I didnt build a specific function for this yet. 2. How to using transaction? assumi

[Sqlalchemy-users] two questions

2005-12-14 Thread limodou
I'm newbie to sqlalchemy, and I'v two questions want to ask: 1. Is there a easy way to detect a table has exist? 2. How to using transaction? Can anyone send me some info? Thanks very much. I'm learning this module now. -- I like python! My Blog: http://www.donews.net/limodou NewEdit Maillist: