vasern / vasern

Vasern is a fast, lightweight and open source data storage for React Native

Home Page:https://vasern.github.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Option for Deleteing DB

kailashvele opened this issue · comments

commented

Hi,

While implementing I came across a scenario where I was initially trying out the Library.

However later when I decided to actually implement in my Application I felt a need to remove all the already present DB data.

Is there any option like deletion of DB or Truncating of the data in Schema or something like data where I can set the DB instance to empty and start using.

Thanks.

Hi Kai,

removeAllRecords is an unofficial method for removing all records in a collection. Usage example: Vasern.Users.removeAllRecords().

There is no method for clear all records from all collection, you will need to go through each of collection and remove one by one.

Cheers.

commented

Hi @hieunc229 ,

Oh, I didn't see removeAllRecords() in documents hence I asked.

Yes, I have been deleting entries by looping over them.

Do you think having method to clear records from all the collection will be helpful?

Hey Kai,

Yes, it'd be helpful. It will free up space used by the database.

Though it hasn't mentioned in the document. You can actually use removeAllRecords() at the current version. :)