New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

manage-database

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

manage-database - npm Package Compare versions

Comparing version 0.1.4 to 0.2.0

.eslintrc.json

4

index.js
'use strict';
var join = require('path').join;
var P = require('bluebird');

@@ -16,3 +17,4 @@ var DIALECTS = ['postgres', 'mysql'];

provider = require('./' + join('lib', dialect));
return provider(opts);
return P.promisifyAll(provider(opts));
};

@@ -25,5 +25,5 @@ 'use strict';

drop: function (name, done) {
execute(fmt('DROP DATABASE IF EXISTS %s;', name), opts, done);
execute(fmt('DROP DATABASE IF EXISTS `%s`;', name), opts, done);
}
};
};

@@ -7,3 +7,3 @@ 'use strict';

function execute(query, opts, done) {
pg.connect(opts, function(err, client) {
pg.connect(opts, function (err, client) {
if (err) {

@@ -14,3 +14,3 @@ pg.end();

return client.query(query, function(err) {
return client.query(query, function (err) {
client.end();

@@ -17,0 +17,0 @@ done(err);

{
"name": "manage-database",
"version": "0.1.4",
"version": "0.2.0",
"description": "Manage databases",

@@ -15,2 +15,6 @@ "main": "index.js",

],
"scripts": {
"lint": "eslint ./lib index.js",
"lint:fix": "eslint --fix ./lib index.js"
},
"author": "Maxim Malov <m.malov.v@gmail.com>",

@@ -23,6 +27,9 @@ "license": "The MIT License (MIT)",

"devDependencies": {
"gulp": "^3.8.9",
"gulp-jshint": "^1.8.5",
"jshint-stylish": "^1.0.0"
"eslint": "^2.1.0"
},
"dependencies": {
"bluebird": "^3.3.1",
"mysql": "^2.10.2",
"pg": "^4.4.6"
}
}

@@ -34,2 +34,11 @@ Manage databases with NodeJS

// or promisified version
dbMgr.createAsync('database_name')
.then(function () {
console.log('database created');
})
.catch(function (err) {
console.error(err);
});
// drop database

@@ -45,2 +54,11 @@ dbMgr.drop('database_name', function (err) {

// or promisified version
dbMgr.dropAsync('database_name')
.then(function () {
console.log('database deleted');
})
.catch(function (err) {
console.error(err);
});
### Options

@@ -47,0 +65,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc