Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

east-rethink

Package Overview
Dependencies
Maintainers
2
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

east-rethink - npm Package Compare versions

Comparing version 0.4.0 to 0.5.0

44

lib/adapter.js

@@ -14,4 +14,6 @@ 'use strict';

if (typeof this.params.database.migrationTable !== 'string') {
this.params.database.migrationTable = 'migration';
if (typeof this.params.database !== 'function') {
this.params.configure = (cb) => cb(null, params.database);
} else {
this.params.configure = this.params.database;
}

@@ -25,11 +27,24 @@ };

Adapter.prototype.configure = function (callback) {
const self = this;
self.params.configure((err, database) => {
if (err) {
return callback(err);
}
self.params.database = database;
self.params.database.migrationTable = self.params.database.migrationTable || 'migration';
callback();
});
}
Adapter.prototype.connect = function (callback) {
const self = this;
const settings = Hoek.clone(self.params.database.connection);
const tableName = self.params.database.migrationTable;
this.db = new Pensuer.Db(self.params.database.name, settings);
this.db.table(self.params.tables);
this.db.connect( (err) => {
self.configure((err) => {
if (err) {

@@ -39,3 +54,7 @@ return callback(err);

this.db.establish({ [tableName]: { purge: false } }, (err) => {
const settings = Hoek.clone(self.params.database.connection);
const tableName = self.params.database.migrationTable;
this.db = new Pensuer.Db(self.params.database.name, settings);
this.db.table(self.params.tables);
this.db.connect( (err) => {

@@ -46,3 +65,10 @@ if (err) {

return callback(null, { db: self.db });
this.db.establish({ [tableName]: { purge: false } }, (err) => {
if (err) {
return callback(err);
}
return callback(null, { db: self.db });
});
});

@@ -49,0 +75,0 @@ });

{
"name": "east-rethink",
"description": "rethinkdb adapter for \"east\" (node.js database migration tool)",
"version": "0.4.0",
"version": "0.5.0",
"repository": {

@@ -6,0 +6,0 @@ "type": "git",

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