|
Post by tjvrdev on Apr 2, 2020 16:25:37 GMT
I'm able to delete all entries from the database by using a for loop and deleting each object in a table one at a time. The problem is I have to keep record of the Keys for each object to delete them. I'm looking for a way to delete all data from the data base since im doing many tests and want to clear the database with erroneous data. So far the easiest way ive found is to just find the data base location in local folders and just delete it. Is there a solution that I can do through code? I also tried to delete using the firefox extension but after dropping table and re opening the database in the extension, the data would still be there.
|
|
|
Post by echo17 on Apr 3, 2020 12:50:04 GMT
Is there a solution that I can do through code? You can use the sql syntax DELETE, like: var sql = "DELETE FROM MyTable"; This clears all entries from a table. You may also want to run the VACUUM command which will reclaim the disk space used by the previous record data. var sql = "VACUUM"; See these links for more information: www.sqlitetutorial.net/sqlite-delete/www.techonthenet.com/sqlite/truncate.phpwww.sqlitetutorial.net/sqlite-vacuum/I also tried to delete using the firefox extension but after dropping table and re opening the database in the extension, the data would still be there. It sounds like you are modifying the data in the project directory. SimpleSQL copies the database from the project directory (actually from the embedded resource created by Unity's build procedure) to a working directory that allows write access. Try modifying the data in the working directory instead, or you can set the overwrite if exists option in SimpleSQLManager to true. Be aware that this will overwrite any data in the working directory and should only be used for static data that does not change at runtime. Please see these FAQs: echo17.proboards.com/thread/2/faq?page=1&scrollTo=9echo17.proboards.com/thread/2/faq?page=1&scrollTo=7
|
|