flatiron/resourceful — Issue #53: Implement purging of memory database
Author: Raynos
Created: 2012-02-09 19:24:52+00:00
State: open

Something like

resourceful.purge = function () {
Object.keys(this.resources).forEach(function (key) {
var resource = resourceful.resources[key];
resource.connection.store = {};
});
};

This will kill the attached memory store for every resource.

This is only useful for unit testing when you want to make sure your memory store is clean for your parallel unit tests.

It would be stupid to use this in production.

I'm not sure whether is "useful enough" to add to resourceful.