0

I try to delete all the elements in my sqlite to reconstruct it with an .sql file. For this I found that code:

PRAGMA writable_schema = 1;
delete from sqlite_master where type in ('table', 'index', 'trigger');
PRAGMA writable_schema = 0;

I use the FMDB to execute SQL commands for info.

I precise that I don't want to empty the tables, I want to completely reconstruct my sqlite, so I need to delete all the elements in the sqlites like tables, indexes. EDIT:
I am trying to do a sort of loop, but sqlite is not SQL, so I don't know how to do it.

Thanks in advance.

ΩlostA
  • 2,501
  • 5
  • 27
  • 63
  • 1
    Why not just delete the database file? Then you start off with a fresh, empty database? – Corion Feb 05 '19 at 11:08
  • @Corion I could do that, but I am anticipating the fact that my customer will ask me to keep some informations in only one table. I am updating the title of the ticket – ΩlostA Feb 05 '19 at 14:22

0 Answers0