Thanks, will give this a shot.

Sent from my Windows Phone From: GHZ
Sent: 14. februar 2011 14:51
To: sqlalchemy
Subject: [sqlalchemy] Re: The right way to clear database of content?
maybe it needs to be in a transaction:


con = engine.connect()

trans = con.begin()

for name, table in meta.tables.items():

    print table.delete()
    con.execute(table.delete())

trans.commit()



On Feb 14, 1:29 pm, Arve Knudsen <arve.knud...@gmail.com> wrote:
> Hi
>
> What's the right way to clear a database all of content, but keep the
> schema? I tried the method of deleting all tables 
> athttp://www.sqlalchemy.org/docs/05/metadata.html#reflecting-all-tables...,
> but content still remains. I couldn't find any documentation on Table.delete
> either, for that matter. Maybe I'm missing something...
>
> Thanks,
> Arve

-- 
You received this message because you are subscribed to the Google
Groups "sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com.
To unsubscribe from this group, send email to
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/sqlalchemy?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to