Login

oneliner to delete SQLite tables

Author:
kifkif
Posted:
October 26, 2009
Language:
SQL
Version:
Not specified
Tags:
sqlite drop oneliner
Score:
0 (after 0 ratings)

I use this oneliner to delete the matching tables in SQLite. Use carefully!

1
echo ".tables" | python manage.py dbshell | tr " " "\n" | grep myapp | sed 's/^/DROP TABLE /g' | sed 's/$/;/g' | python manage.py dbshell

More like this

  1. grep and delete sqlite tables by kifkif 5 years, 6 months ago
  2. SQLite database vacuum script by pbx 8 years, 1 month ago
  3. fast table flush without raw SQL by dsblank 5 years, 6 months ago
  4. Prefetch id for Postgresql backend by bretth 3 years, 2 months ago
  5. Searching and Deleting Cache Entries in Admin tool by shootclub 3 years, 11 months ago

Comments

Please login first before commenting.