SQLite Forum

Reset database
Login
After 

> .open mydb.db

On checking the properties of mydb.db, its size is 0. 

I am able to set the length of the file to 0 and can open or attach it using the sqlite3 APIs.

There is no DROP DATABASE or TRUNCATE DAATABASE. I did not want to simply drop the tables and views as I believe that will lead to fragmentation. I am not sure whether VACUUM locks the database.

Setting the file length to zero is faster than getting the list of objects and deleting each one and vacuuming the database; so, I'll settle for this ... unless there are side effects that I haven't thought of?