Skip to content

Instantly share code, notes, and snippets.


ianpward/reset.js Secret

Last active Sep 20, 2017
What would you like to do?
Realm Data Adapter Reset Script
const PostgresController = require('realm-data-adapters').PostgresController;
const spawnSync = require('child_process').spawnSync;
const Config = require('./config');
// Remove db and replication slot
console.log(`Dropping replication slot '${Config.database_name}'`);
console.log(`Removing ${Config.database_name} database`);
PostgresController.removePostgresDB(Config.database_name, Config.postgres_config);
// Remove old data
spawnSync( 'rm -rf ./realm-object-server' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment