Re: [sqlalchemy] Re: The right way to clear database of content?

2011-02-15 Thread Arve Knudsen
, 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

Re: [sqlalchemy] Re: The right way to clear database of content?

2011-02-15 Thread Arve Knudsen
correct way to delete all data. On Feb 15, 1:29 pm, Arve Knudsen arve.knud...@gmail.com wrote: Thank you GHZ, it did work! Wondering about one thing though; the recipe in the documentation iterates over the tables in reverse sorted order, like so: for table in reversed(meta.sorted_tables

[sqlalchemy] The right way to clear database of content?

2011-02-14 Thread Arve Knudsen
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 at http://www.sqlalchemy.org/docs/05/metadata.html#reflecting-all-tables-at-once, but content still remains. I couldn't find any documentation on Table.delete either, for

RE: [sqlalchemy] Re: The right way to clear database of content?

2011-02-14 Thread Arve Knudsen
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