I donβt think you can delete all tables with one hit, but you can do the following to get the commands:
select 'drop table ' || name || ';' from sqlite_master where type = 'table';
The result of this is a script that will output the tables for you. For indexes, simply replace the table with an index.
You can use other clauses in the where clause to limit which tables or indexes are selected (for example, " and name glob 'pax_*' " for those starting with "pax _").
You could combine the creation of this script with its launch in a simple bash (or cmd.exe) script, so only one command will work.
If you don't care about any information in the database, I think you can just delete the file that it stores on your hard drive - which is probably faster. I have never tested this, but I do not understand why this will not work.
paxdiablo Feb 08 '09 at 10:42 2009-02-08 10:42
source share