question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

For tests, we need to clear/truncate all the tables. What’s the best what to do that? I’m currently iterating through each and realm.objects(name).delete(results);

Is there one method to start over the whole db?

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

7reactions
alaziercommented, Sep 8, 2015

This has been added in the form of:

realm.deleteAll();
1reaction
brunodasilvalengacommented, Mar 31, 2017

Hello, did not work for me 😕

try { realm.write(() => { realm.deleteAll() }) } catch (err) { if (err) Promise.reject(new Error(Error. Log: ${err})) }

I received this message: Acecessing object of type Message which has been invalidated or deleted.

Obs; ‘Message’ is my schema.

Read more comments on GitHub >

github_iconTop Results From Across the Web

RESET DATABASE
To reset the database to a previous incarnation. Typically, you would reset the incarnation when performing incomplete recovery to a point before a...
Read more >
RESET DATABASE CONFIGURATION command - IBM
The RESET DATABASE CONFIGURATION command resets the configuration of a specific database to the system defaults.
Read more >
reset-db-cluster-parameter-group - AWS Documentation
To reset the entire DB cluster parameter group, specify the DBClusterParameterGroupName and ResetAllParameters parameters. When resetting the entire group, ...
Read more >
Rails 7 adds database-specific setup and reset tasks for multi ...
For multi DB Rails applications starting with Rails 7, we can now setup and reset a particular database.
Read more >
How to restart your Ruby on Rails database - Emma Goto
rake db:reset. Your database will be dropped and it will be recreated using whatever is currently stored in your db/schema.rb file.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found