manage-database
Advanced tools
Comparing version 0.1.3 to 0.1.4
@@ -22,3 +22,3 @@ 'use strict'; | ||
create: function (name, done) { | ||
execute(fmt('CREATE DATABASE %s;', name), opts, done); | ||
execute(fmt('CREATE DATABASE IF NOT EXISTS `%s`;', name), opts, done); | ||
}, | ||
@@ -29,2 +29,2 @@ drop: function (name, done) { | ||
}; | ||
}; | ||
}; |
{ | ||
"name": "manage-database", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"description": "Manage databases", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -15,5 +15,5 @@ Manage databases with NodeJS | ||
``` | ||
var dbManagerProvider = require('manage-database'); | ||
var createDbManager = require('manage-database'); | ||
var dbManager = dbManagerProvider({ | ||
var dbManager = createDbManager({ | ||
user: 'username', | ||
@@ -27,6 +27,18 @@ password: 'password', | ||
// create database | ||
dbMgr.create('database_name'); | ||
dbMgr.create('database_name', function (err) { | ||
if (err) { | ||
console.error(err); | ||
return; | ||
} | ||
console.log('database created'); | ||
}); | ||
// drop database | ||
dbMgr.drop('database_name'); | ||
dbMgr.drop('database_name', function (err) { | ||
if (err) { | ||
console.error(err); | ||
return; | ||
} | ||
console.log('database deleted'); | ||
}); | ||
``` | ||
@@ -33,0 +45,0 @@ |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
6047
72
89
1