cloudelements-dbtool
v0.1.3
Published
A simple command-line utility to perform some simple database tasks.
Downloads
6
Readme
Cloud Elements DBTool
This is the Cloud Elements DB tool, which is used to manage cloud-elements data directly.
Install (or update) it globally:
$ npm install -g cloudelements-dbtool
$ npm update -g cloudelements-dbtoolYou may also need to set some environment variables: (you could put
these in your ~/.bash_profile or other startup script)
$ export DBTOOL_DB_URL=postgres://username:password@localhost:5432/elementsOnce these are sorted, you can use the dbtool from the command line:
$ dbtool <command> [parameters]For example,
$ dbtool delete-user [email protected]Or, you can use it in your javascript code:
var Dbtool = require('dbtool').Dbtool,
dbUrl = 'postgres://username:password@localhost:5432/elements',
dbtool = new Dbtool(dbUrl),
email = '[email protected]';
dbtool.deleteUser(email, function(err){
if (err != null) {
say("err: ", err);
} else {
say("Delete " + email + " complete");
}
});