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

rethinkdb-fixtures

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rethinkdb-fixtures - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

Dockerfile

3

index.js
'use strict';
module.exports.Prepare = require('./lib/prepare');
module.exports.Readfixture = require('./lib/readfixture');
module.exports.all = require('./lib/readall');
module.exports.Base = require('./lib/base');
module.exports.Insert = require('./lib/insert');
module.exports.Delete = require('./lib/delete');
'use strict';
const Promise = require('bluebird');
const Prepare = require('./prepare');
Promise = require('bluebird');
const Base = require('./base');
const _delete = function (dbOptions,tables) {
const _delete = function (tables) {
const prep = Prepare(dbOptions);
return new Promise( (resolve,reject) => {
prep.connect()
this.connect()
.then((message) => {

@@ -17,3 +15,3 @@

return prep.deleteTable(table);
return this.deleteTable(table);
});

@@ -25,2 +23,3 @@ return Promise.all(promises);

resolve(result);
this.close();
}, reject);

@@ -30,2 +29,5 @@ });

module.exports = _delete;
module.exports = function(options,tables) {
return _delete.call(new Base(options),tables);
};
'use strict';
const Promise = require('bluebird');
const Prepare = require('./prepare');
Promise = require('bluebird');
const insert = function (options, fixture) {
const Base = require('./base');
const prep = Prepare(options);
let messageCallback = function () {};
const insert = function (fixture) {
if (options.verbose === 1) {
messageCallback = console.log;
}
return new Promise( (resolve,reject) => {
prep.connect()
.then(messageCallback, reject)
.then(prep.createTablesUnlessExist.bind(prep,Object.keys(fixture)),reject)
.then(prep.fill.bind(prep, fixture),reject)
this.connect()
.then(this.emptyCallback.bind(this), reject)
.then(this.createTablesUnlessExist.bind(this,Object.keys(fixture)),reject)
.then(this.fill.bind(this, fixture),reject)
.then( (result) => {

@@ -30,4 +24,4 @@

this.close();
resolve(pack);
prep.close();
},reject);

@@ -37,2 +31,5 @@ });

module.exports = insert;
module.exports = function(options,fixture) {
return insert.call(new Base(options),fixture);
};
{
"name": "rethinkdb-fixtures",
"version": "0.0.3",
"version": "0.0.4",
"description": "Easily load fixtures into Rethinkdb. Useful for testing.",

@@ -25,10 +25,11 @@ "main": "index.js",

"dependencies": {
"bluebird": "^3.1.5",
"lodash": "^4.0.1",
"rethinkdb": "^2.2.1"
"bluebird": "^3.4.0",
"glob": "^7.0.3",
"lodash": "^4.13.1",
"rethinkdb": "^2.3.2"
},
"devDependencies": {
"code": "^2.1.0",
"lab": "^8.0.1"
"code": "^3.0.0",
"lab": "^10.7.1"
}
}

@@ -12,3 +12,4 @@ 'use strict';

const options = {
db: 'test',
host: process.env.RETHINKDB_PORT_8080_TCP_ADDR,
db: process.env.RETHINKDB || 'test',
verbose: 1

@@ -15,0 +16,0 @@ };

'use strict';
const Insert = require('../index').Insert;
const Delete = require('../index').Delete;
const Lab = require('lab');

@@ -11,3 +12,4 @@ const Code = require('code');

const options = {
db: 'test'
host: process.env.RETHINKDB_PORT_8080_TCP_ADDR,
db: process.env.RETHINKDB || 'test'
};

@@ -33,2 +35,8 @@

lab.after( (done) => {
Delete(options, ['items','artists']);
done();
});
lab.test('it inserts', (done) => {

@@ -35,0 +43,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