Login

oneliner to delete SQLite tables

Author:
kifkif
Posted:
October 26, 2009
Language:
SQL
Version:
Not specified
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. create_template_postgis-ubuntu_lucid by clawlor 11 years, 8 months ago
  2. PostgreSQL fulltext with language translations by diverman 11 years, 9 months ago
  3. Drop all tables in MySQL database by mpasternacki 12 years, 3 months ago
  4. grep and delete sqlite tables by kifkif 12 years, 5 months ago
  5. Substitute hyphens with spaces to enale URLs to reference to multi-word tags by miernik 12 years, 6 months ago

Comments

Please login first before commenting.