Realm-js: Equivalent of deleteRealmFile in JS

Created on 31 Mar 2016  路  5Comments  路  Source: realm/realm-js

Something like in https://github.com/realm/realm-java/issues/834 to delete the realm file.

T-Feature

Most helpful comment

There is currently an undocumented method used by the tests which deletes all realm files in the documents directory. You can do this by calling Realm.clearTestState();

Is this the behavior that you want, or you do you want the ability to specify individual Realm files rather than deleting all Realm? If the current behavior is sufficient then we can rename and document the existing functionality.

All 5 comments

There is currently an undocumented method used by the tests which deletes all realm files in the documents directory. You can do this by calling Realm.clearTestState();

Is this the behavior that you want, or you do you want the ability to specify individual Realm files rather than deleting all Realm? If the current behavior is sufficient then we can rename and document the existing functionality.

This is actually good, but why this name?

Because this method is meant as a utility for tests only.

@alazier please give us the API like the clearTestState behavior. I am just wondering why is it so hard to delete the database? For a particular point in time, I'm pretty sure what I want to do with my app and I really want just to refresh everything again. My question is, why do I need to go through all the things like define the configuration, put into an object .... to delete just some files I am totally aware that I don't want to have?

@bubuzzz Realm is using a few aux. files. Why can't you use Realm.deleteFile()?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kevinnguy picture kevinnguy  路  3Comments

texas697 picture texas697  路  3Comments

CrystalRanita picture CrystalRanita  路  3Comments

blagoev picture blagoev  路  3Comments

MihaelIsaev picture MihaelIsaev  路  3Comments