[PonyORM-list] How to purge table rows

Vsevolod Novikov nnseva at gmail.com
Thu Dec 19 09:17:55 UTC 2013


I don't know what the database engine you are using, but most of them
support the following syntax to erase all rows and reset autoincrement
counters on the table:

TRUNCATE table_name

where table_name is the name of the table to be erased.

This is exactly what you whould like to have.



2013/12/19 Guy Jacks <guy.jacks at gmail.com>

> I'm currently calling.
>
> db.drop_table(...) and then calling db.create_tables() in order to purge
> all of the data.  I'm using flask so I wrapped my app in the
> with_transaction context.  I'm getting the following error.
>
> https://gist.github.com/anonymous/9005f162fc6f352a73fc
>
> Note, I don't want to delete all the rows because I want to reset the
> auto-increment on the ids.
>
> _______________________________________________
> ponyorm-list mailing list
> ponyorm-list at ponyorm.com
> /ponyorm-list
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </ponyorm-list/attachments/20131219/0704d67d/attachment.html>


More information about the ponyorm-list mailing list