On Mon, 2011-11-14 at 06:02 -0800, DenesL wrote: > Hi Archibald, > > if you want to clear all records from a table do: > > db.table.truncate() > > To clear all just loop thru db.tables . > > db.commit() to finish. > > It should work for all DBs. > > > On Nov 14, 7:56 am, Archibald Linx <[email protected]> wrote: > > Thank you Bruno. > > > > I am using SQLite. > > > > I want to reset all the tables of my project.
* If you want to delete *content* of some specific table, use
``db.table.truncate()``, as DenesL says.
* If you want the DAL to recreate the whole table (with SQLite, the
allowed alters are limited, sometimes table drop is needed in order to
clean up): ``db.table.truncate()``
* If you want to completely destroy and recreate the whole database,
just empty the ``databases`` folder inside your application directory.
--
Samuele ~redShadow~ Santi
----------------------------------------------------------------
redshadow[at]hackzine.org - redshadowhack[at]gmail.com
Blog: http://hackzine.org
GPG Key signature:
050D 3E9F 6E0B 44CE C008 D1FC 166C 3C7E EB26 4933
----------------------------------------------------------------
/me recommends:
Squadra Informatica - http://www.squadrainformatica.com
----------------------------------------------------------------
- Proud ThinkPad T-Series owner
- Registered Linux-User: #440008
* GENTOO User since 1199142000 (2008-01-01)
* former DEBIAN SID user
----------------------------------------------------------------
"Software is like sex: it's better when it's free!"
-- Linus Torvalds
signature.asc
Description: This is a digitally signed message part

