I poked through the sqlite source code and tried to force "sqlite3ResetOneSchema" or "sqlite3SchemaClear"... and found no clear way to do it...

I found however an workaround: before clearing the file I get the table list and execute a rename (alter) for each table using fake names. Then delete from sqlite_master.
After this recreating the tables works fast as expected.

After closing the transaction the database structure should be valid of any reader; i also call afterwards vacuum/checkpoint to trim the space.
The fake tables/names are also simply lost after the whole process.

While this it works for me, I still think it is a weakness.
Regards,
Gabriel

--
Using Opera's revolutionary email client: http://www.opera.com/mail/
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to