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

rethinkdbdash

Package Overview
Dependencies
Maintainers
1
Versions
153
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rethinkdbdash - npm Package Compare versions

Comparing version 1.12.7 to 1.12.8

3

lib/cursor.js

@@ -124,5 +124,4 @@ var Promise = require("bluebird");

if (data.done) this._done();
response = data.response;
this._fetching = false;
this._data.push(pb.makeSequence(response, this.options));
this._data.push(pb.makeSequence(data.response, this.options));

@@ -129,0 +128,0 @@ if (this.closeAsap === true) {

@@ -253,3 +253,4 @@ var helper = require(__dirname+"/helper.js");

DATUM: function(term, index, father, frames, options) {
underline = Array.isArray(frames) && (frames.length === 0);
var currentFrame;
var underline = Array.isArray(frames) && (frames.length === 0);
if (Array.isArray(frames)) currentFrame = frames.shift();

@@ -256,0 +257,0 @@

@@ -182,3 +182,3 @@ var Promise = require('bluebird');

if (helper.isPlainObject(options)) {
for(key in options) {
for(var key in options) {
this.options[key] = options[key];

@@ -185,0 +185,0 @@ }

{
"name": "rethinkdbdash",
"version": "1.12.7",
"version": "1.12.8",
"description": "A Node.js driver for RethinkDB with promises and a connection pool",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -10,3 +10,3 @@ var config = require(__dirname+'/config.js');

var connection; // global connection
var dbName;
var dbName, tableName, result;

@@ -50,8 +50,8 @@ It("Testing `run` without connection", function* (done) {

dbName = uuid();
tableName = uuid();
var tableName = uuid();
var result = yield r.dbCreate(dbName).run(connection);
result = yield r.dbCreate(dbName).run(connection);
assert.deepEqual(result, {created:1});
var result = yield r.db(dbName).tableCreate(tableName).run(connection);
result = yield r.db(dbName).tableCreate(tableName).run(connection);
assert.deepEqual(result, {created:1});

@@ -61,3 +61,3 @@

assert.equal(result.inserted, 100);
pks = result.generated_keys;
var pks = result.generated_keys;

@@ -177,3 +177,3 @@ done();

try{
var result = yield connection.noReplyWait()
result = yield connection.noReplyWait()
}

@@ -192,3 +192,3 @@ catch(e) {

try{
var result = yield connection.noreplyWait()
result = yield connection.noreplyWait()
done();

@@ -211,3 +211,3 @@ }

var result = yield r.expr(1).run(connection, {useOutdated: true});
result = yield r.expr(1).run(connection, {useOutdated: true});
assert.equal(result, 1);

@@ -240,3 +240,3 @@

try {
var result = yield r.expr(1).run(connection, {db: "db"});
result = yield r.expr(1).run(connection, {db: "db"});
}

@@ -256,3 +256,3 @@ catch(e) {

try {
var result = yield r(1).run(connection);
result = yield r(1).run(connection);
assert.deepEqual(result, 1)

@@ -268,3 +268,3 @@ done();

try {
var result = yield r.now().run(connection);
result = yield r.now().run(connection);
assert(result instanceof Date);

@@ -302,3 +302,3 @@

try{
var result = yield r.expr(true).run(connection, {profile: false});
result = yield r.expr(true).run(connection, {profile: false});
assert(result)

@@ -326,3 +326,3 @@

var result = yield r.expr(1).add(1).add(1).add(1).add(1).add(1).add(1).add(1)
result = yield r.expr(1).add(1).add(1).add(1).add(1).add(1).add(1).add(1)
.add(1).add(1).add(1).add(1).add(1).add(1).add(1).add(1).add(1).add(1)

@@ -329,0 +329,0 @@ .add(1).add(1).add(1).add(1).add(1).add(1).add(1).add(1).add(1).add(1)

@@ -43,3 +43,3 @@ var config = require(__dirname+'/config.js');

try {
result = yield r.db(dbName).table(tableName).reduce().run();
var result = yield r.db(dbName).table(tableName).reduce().run();
}

@@ -58,3 +58,3 @@ catch(e) {

try {
result = yield r.expr([0, 1, 2, 3, 4, 5]).count().run();
var result = yield r.expr([0, 1, 2, 3, 4, 5]).count().run();
assert.equal(result, 6);

@@ -70,3 +70,3 @@

try {
result = yield r.expr([0, 1, 2, 3, 4, 5]).count(r.row.eq(2)).run();
var result = yield r.expr([0, 1, 2, 3, 4, 5]).count(r.row.eq(2)).run();
assert.equal(result, 1);

@@ -85,3 +85,3 @@

try {
result = yield r.expr([{name: "Michel", grownUp: true},{name: "Laurent", grownUp: true},
var result = yield r.expr([{name: "Michel", grownUp: true},{name: "Laurent", grownUp: true},
{name: "Sophie", grownUp: true},{name: "Luke", grownUp: false},{name: "Mino", grownUp: false}]).group('grownUp').run();

@@ -101,3 +101,3 @@ result = yield result.toArray();

try {
result = yield r.expr([{name: "Michel", grownUp: true},{name: "Laurent", grownUp: true},
var result = yield r.expr([{name: "Michel", grownUp: true},{name: "Laurent", grownUp: true},
{name: "Sophie", grownUp: true},{name: "Luke", grownUp: false},{name: "Mino", grownUp: false}]).group('grownUp').run({groupFormat: "raw"});

@@ -117,3 +117,3 @@

try {
result = yield r.expr([{name: "Michel", grownUp: true},{name: "Laurent", grownUp: true},
var result = yield r.expr([{name: "Michel", grownUp: true},{name: "Laurent", grownUp: true},
{name: "Sophie", grownUp: true},{name: "Luke", grownUp: false},{name: "Mino", grownUp: false}]).group('grownUp').ungroup().run();

@@ -134,3 +134,3 @@ result = yield result.toArray();

try{
result = yield r.expr([1,2,3]).contains(2).run();
var result = yield r.expr([1,2,3]).contains(2).run();
assert.equal(result, true);

@@ -164,3 +164,3 @@

try {
result = yield r.db(dbName).table(tableName).contains().run();
var result = yield r.db(dbName).table(tableName).contains().run();
}

@@ -179,3 +179,3 @@ catch(e) {

try{
result = yield r.expr([1,2,3]).sum().run();
var result = yield r.expr([1,2,3]).sum().run();
assert.equal(result, 6);

@@ -192,3 +192,3 @@

try {
result = yield r.expr([{a: 2}, {a: 10}, {a: 9}]).sum('a').run();
var result = yield r.expr([{a: 2}, {a: 10}, {a: 9}]).sum('a').run();
assert.deepEqual(result, 21)

@@ -207,3 +207,3 @@ done();

try{
result = yield r.expr([1,2,3]).avg().run();
var result = yield r.expr([1,2,3]).avg().run();
assert.equal(result, 2);

@@ -219,3 +219,3 @@ done();

try {
result = yield r.expr([{a: 2}, {a: 10}, {a: 9}]).avg('a').run();
var result = yield r.expr([{a: 2}, {a: 10}, {a: 9}]).avg('a').run();
assert.equal(result, 7);

@@ -231,3 +231,3 @@ done();

try{
result = yield r.expr([1,2,3]).min().run();
var result = yield r.expr([1,2,3]).min().run();
assert.equal(result, 1);

@@ -243,3 +243,3 @@ done();

try {
result = yield r.expr([{a: 2}, {a: 10}, {a: 9}]).min('a').run();
var result = yield r.expr([{a: 2}, {a: 10}, {a: 9}]).min('a').run();
assert.deepEqual(result, {a: 2})

@@ -255,3 +255,3 @@ done();

try{
result = yield r.expr([1,2,3]).max().run();
var result = yield r.expr([1,2,3]).max().run();
assert.equal(result, 3);

@@ -267,3 +267,3 @@ done();

try {
result = yield r.expr([{a: 2}, {a: 10}, {a: 9}]).max('a').run();
var result = yield r.expr([{a: 2}, {a: 10}, {a: 9}]).max('a').run();
assert.deepEqual(result, {a: 10})

@@ -270,0 +270,0 @@ done();

@@ -9,3 +9,3 @@ var config = require(__dirname+'/config.js');

var dbName, tableName;
var dbName, tableName, result;

@@ -94,3 +94,3 @@ It("`do` should work", function* (done) {

try {
var result = yield r.expr(1).branch(true, true, true).run();
result = yield r.expr(1).branch(true, true, true).run();
}

@@ -111,9 +111,9 @@ catch(e) {

var result = yield r.dbCreate(dbName).run();
result = yield r.dbCreate(dbName).run();
assert.deepEqual(result, {created:1})
var result = yield r.db(dbName).tableCreate(tableName).run();
result = yield r.db(dbName).tableCreate(tableName).run();
assert.deepEqual(result, {created:1})
var result = yield r.expr([{foo: "bar"}, {foo: "foo"}]).forEach(function(doc) {
result = yield r.expr([{foo: "bar"}, {foo: "foo"}]).forEach(function(doc) {
return r.db(dbName).table(tableName).insert(doc)

@@ -131,3 +131,3 @@ }).run();

try{
var result = yield r.expr([{foo: "bar"}, {foo: "foo"}]).forEach().run();
result = yield r.expr([{foo: "bar"}, {foo: "foo"}]).forEach().run();
}

@@ -156,3 +156,3 @@ catch(e) {

try {
var result = yield r.expr(1).error("error").run();
result = yield r.expr(1).error("error").run();
}

@@ -196,3 +196,3 @@ catch(e) {

try {
var result = yield r.expr(1).js("foo").run();
result = yield r.expr(1).js("foo").run();
}

@@ -289,3 +289,3 @@ catch(e) {

try {
var result = yield r.expr(1).json("1").run();
result = yield r.expr(1).json("1").run();
}

@@ -292,0 +292,0 @@ catch(e) {

@@ -9,3 +9,3 @@ var config = require('./config.js');

var dbName, tableName, tableName2, cursor;
var dbName, tableName, tableName2, cursor, result;

@@ -27,3 +27,3 @@ var numDocs = 100; // Number of documents in the "big table" used to test the SUCCESS_PARTIAL

var result = yield [r.dbCreate(dbName).run(), r.db(dbName).tableCreate(tableName).run(), r.db(dbName).tableCreate(tableName2).run()]
result = yield [r.dbCreate(dbName).run(), r.db(dbName).tableCreate(tableName).run(), r.db(dbName).tableCreate(tableName2).run()]
assert.deepEqual(result, [{created:1}, {created:1}, {created:1}]);

@@ -42,3 +42,2 @@

assert.equal(result.inserted, numDocs);
pks = result.generated_keys;
done();

@@ -54,3 +53,2 @@ }

assert.equal(result.inserted, smallNumDocs);
pks = result.generated_keys;
done();

@@ -90,3 +88,3 @@ }

try {
var result = yield cursor.next();
result = yield cursor.next();
assert(result);

@@ -106,3 +104,3 @@ assert(result.id);

assert(cursor);
i=0;
var i=0;
while(cursor.hasNext()) {

@@ -123,3 +121,3 @@ result = yield cursor.next();

try {
var result = yield r.db(dbName).table(tableName).run({profile: true, timeFormat: 'raw'});
result = yield r.db(dbName).table(tableName).run({profile: true, timeFormat: 'raw'});
assert(result);

@@ -182,3 +180,3 @@ assert(result.profile);

try {
var result = yield cursor.next();
result = yield cursor.next();
assert(result);

@@ -197,3 +195,3 @@ assert(result.id);

assert(cursor);
i=0;
var i=0;
while(cursor.hasNext()) {

@@ -213,3 +211,3 @@ result = yield cursor.next();

try {
cursor = yield r.db(dbName).table(tableName2).run();
var cursor = yield r.db(dbName).table(tableName2).run();
result = yield cursor.toArray();

@@ -227,3 +225,3 @@ assert.equal(result.length, smallNumDocs);

try {
cursor = yield r.db(dbName).table(tableName2).run();
var cursor = yield r.db(dbName).table(tableName2).run();
yield cursor.close();

@@ -238,4 +236,4 @@ done();

try {
cursor = yield r.db(dbName).table(tableName).run();
cursor2 = yield r.db(dbName).table(tableName2).run();
var cursor = yield r.db(dbName).table(tableName).run();
var cursor2 = yield r.db(dbName).table(tableName2).run();
assert.deepEqual(JSON.stringify("You cannot serialize to JSON a cursor. Retrieve data from the cursor with `toArray` or `next`."), JSON.stringify(cursor));

@@ -275,6 +273,6 @@ assert.deepEqual(JSON.stringify("You cannot serialize to JSON a cursor. Retrieve data from the cursor with `toArray` or `next`."), JSON.stringify(cursor2));

try {
connection = yield r.connect({batch_conf: 10, host: config.host, port: config.port, authKey: config.authKey});
var connection = yield r.connect({batch_conf: 10, host: config.host, port: config.port, authKey: config.authKey});
assert(connection);
cursor = yield r.db(dbName).table(tableName)
var cursor = yield r.db(dbName).table(tableName)
.orderBy({index: "id"})

@@ -281,0 +279,0 @@ .map(r.row("val").add(1))

@@ -10,3 +10,3 @@ var config = require(__dirname+'/config.js');

var uuid = util.uuid;
var dbName, tableName;
var dbName, tableName, result, result2;

@@ -16,3 +16,3 @@

try {
var result = yield r.now().run();
result = yield r.now().run();
assert(result instanceof Date);

@@ -42,3 +42,3 @@

try {
var result = yield r.expr(1).now("foo").run();
result = yield r.expr(1).now("foo").run();
}

@@ -112,3 +112,3 @@ catch(e) {

try {
var result = yield r.expr(1).time(1, 2, 3, 'Z').run();
result = yield r.expr(1).time(1, 2, 3, 'Z').run();
}

@@ -127,3 +127,3 @@ catch(e) {

try {
now = new Date();
var now = new Date();
result = yield r.epochTime(now.getTime()/1000).run();

@@ -153,3 +153,3 @@ assert.deepEqual(now, result);

try {
var result = yield r.expr(1).epochTime(Date.now()).run();
result = yield r.expr(1).epochTime(Date.now()).run();
}

@@ -217,3 +217,3 @@ catch(e) {

try {
var result = yield r.expr(1).ISO8601('validISOstring').run();
result = yield r.expr(1).ISO8601('validISOstring').run();
}

@@ -462,3 +462,3 @@ catch(e) {

try {
now = new Date();
var now = new Date();
result = yield r.epochTime(now.getTime()/1000).run({timeFormat: "raw"});

@@ -465,0 +465,0 @@ assert.equal(result.$reql_type$, "TIME")

@@ -10,3 +10,3 @@ var config = require(__dirname+'/config.js');

var uuid = util.uuid;
var dbName, tableName;
var dbName, tableName, result;

@@ -47,3 +47,3 @@

try {
var result = yield r.expr(1).expr("foo").run();
result = yield r.expr(1).expr("foo").run();
}

@@ -74,3 +74,3 @@ catch(e) {

var result = yield r.exprJSON([{}, {}]).run();
result = yield r.exprJSON([{}, {}]).run();
result = yield result.toArray();

@@ -186,3 +186,3 @@ assert.deepEqual(result, [{}, {}]);

r.setNestingLevel(100);
var result = yield r.expr({a :{b: {c: {d: 1}}}}).run();
result = yield r.expr({a :{b: {c: {d: 1}}}}).run();
assert.deepEqual(result, {a :{b: {c: {d: 1}}}})

@@ -189,0 +189,0 @@ done();

@@ -10,3 +10,3 @@ var config = require(__dirname+'/config.js');

var uuid = util.uuid;
var dbName, tableName;
var dbName, tableName, result;

@@ -18,6 +18,6 @@ It("Init for `document-manipulation.js`", function* (done) {

var result = yield r.dbCreate(dbName).run();
result = yield r.dbCreate(dbName).run();
assert.deepEqual(result, {created:1});
var result = yield r.db(dbName).tableCreate(tableName).run();
result = yield r.db(dbName).tableCreate(tableName).run();
assert.deepEqual(result, {created:1});

@@ -34,3 +34,3 @@

try {
var result = yield r.expr([1,2,3]).map(r.row).run();
result = yield r.expr([1,2,3]).map(r.row).run();
result = yield result.toArray();

@@ -209,3 +209,3 @@ assert.deepEqual(result, [1,2,3]);

try {
var result = yield r.expr(1).literal("foo").run();
result = yield r.expr(1).literal("foo").run();
}

@@ -212,0 +212,0 @@ catch(e) {

@@ -10,3 +10,3 @@ var config = require(__dirname+'/config.js');

var uuid = util.uuid;
var dbName, tableName;
var dbName, tableName, result, pks;

@@ -19,6 +19,6 @@

var result = yield r.dbCreate(dbName).run();
result = yield r.dbCreate(dbName).run();
assert.deepEqual(result, {created:1});
var result = yield r.db(dbName).tableCreate(tableName).run();
result = yield r.db(dbName).tableCreate(tableName).run();
assert.deepEqual(result, {created:1});

@@ -44,3 +44,3 @@

try {
var result = yield r.expr([1,2,3]).innerJoin(r.expr([1,2,3]), function(left, right) { return left.eq(right) }).run();
result = yield r.expr([1,2,3]).innerJoin(r.expr([1,2,3]), function(left, right) { return left.eq(right) }).run();
result = yield result.toArray();

@@ -56,3 +56,3 @@ assert.deepEqual(result, [{left:1, right:1}, {left:2, right: 2}, {left:3, right: 3}]);

try {
var result = yield r.expr([1,2,3]).innerJoin(r.db(dbName).table(tableName), function(left, right) { return left.eq(right("val")) }).run();
result = yield r.expr([1,2,3]).innerJoin(r.db(dbName).table(tableName), function(left, right) { return left.eq(right("val")) }).run();
result = yield result.toArray();

@@ -75,3 +75,3 @@ assert.equal(result.length, 3);

try {
var result = yield r.db(dbName).table(tableName).innerJoin(r.db(dbName).table(tableName), function(left, right) { return left.eq(right) }).run();
result = yield r.db(dbName).table(tableName).innerJoin(r.db(dbName).table(tableName), function(left, right) { return left.eq(right) }).run();
result = yield result.toArray();

@@ -122,3 +122,3 @@ assert.equal(result.length, 3);

try {
var result = yield r.expr([1,2,3]).outerJoin(r.expr([1,2,3]), function(left, right) { return left.eq(right) }).run();
result = yield r.expr([1,2,3]).outerJoin(r.expr([1,2,3]), function(left, right) { return left.eq(right) }).run();
result = yield result.toArray();

@@ -134,3 +134,3 @@ assert.deepEqual(result, [{left:1, right:1}, {left:2, right: 2}, {left:3, right: 3}]);

try {
var result = yield r.expr([1,2,3,4]).outerJoin(r.db(dbName).table(tableName), function(left, right) { return left.eq(right("val")) }).run();
result = yield r.expr([1,2,3,4]).outerJoin(r.db(dbName).table(tableName), function(left, right) { return left.eq(right("val")) }).run();
result = yield result.toArray();

@@ -154,3 +154,3 @@ assert.equal(result.length, 4);

try {
var result = yield r.expr([1,2,3,4]).outerJoin(r.db(dbName).table(tableName), function(left, right) { return left.eq(right("val")) }).run();
result = yield r.expr([1,2,3,4]).outerJoin(r.db(dbName).table(tableName), function(left, right) { return left.eq(right("val")) }).run();
result = yield result.toArray();

@@ -175,3 +175,3 @@ assert.equal(result.length, 4);

try {
var result = yield r.db(dbName).table(tableName).outerJoin(r.db(dbName).table(tableName), function(left, right) { return left.eq(right) }).run();
result = yield r.db(dbName).table(tableName).outerJoin(r.db(dbName).table(tableName), function(left, right) { return left.eq(right) }).run();
result = yield result.toArray();

@@ -178,0 +178,0 @@ assert.equal(result.length, 3);

@@ -10,3 +10,3 @@ var config = require(__dirname+'/config.js');

var uuid = util.uuid;
var dbName, tableName;
var dbName, tableName, result;

@@ -16,3 +16,3 @@

try {
var result = yield r.expr(1).run();
result = yield r.expr(1).run();
assert(result, 1);

@@ -28,4 +28,4 @@ done();

try {
var result = yield r.dbList().run();
var result = yield result.toArray();
result = yield r.dbList().run();
result = yield result.toArray();
assert(Array.isArray(result));

@@ -43,3 +43,3 @@ done();

var result = yield r.dbCreate(dbName).run();
result = yield r.dbCreate(dbName).run();
assert.deepEqual(result, {created:1});

@@ -55,3 +55,3 @@

try {
var result = yield r.dbCreate().run();
result = yield r.dbCreate().run();
}

@@ -69,3 +69,3 @@ catch(e) {

try {
var result = yield r.expr(1).dbCreate("foo").run();
result = yield r.expr(1).dbCreate("foo").run();
}

@@ -83,3 +83,3 @@ catch(e) {

try {
var result = yield r.expr(1).db("foo").run();
result = yield r.expr(1).db("foo").run();
}

@@ -97,3 +97,3 @@ catch(e) {

try {
var result = yield r.db("-_-").run();
result = yield r.db("-_-").run();
}

@@ -107,4 +107,4 @@ catch(e) {

try {
var result = yield r.dbList().run();
var result = yield result.toArray();
result = yield r.dbList().run();
result = yield result.toArray();
assert(Array.isArray(result));

@@ -129,3 +129,3 @@

try {
var result = yield r.dbDrop(dbName).run();
result = yield r.dbDrop(dbName).run();
assert.deepEqual(result, {dropped:1});

@@ -141,3 +141,3 @@

try {
var result = yield r.dbDrop("foo", "bar", "ette").run();
result = yield r.dbDrop("foo", "bar", "ette").run();
}

@@ -155,3 +155,3 @@ catch(e) {

try {
var result = yield r.dbDrop().run();
result = yield r.dbDrop().run();
}

@@ -169,3 +169,3 @@ catch(e) {

try {
var result = yield r.expr(1).dbDrop("foo").run();
result = yield r.expr(1).dbDrop("foo").run();
}

@@ -183,3 +183,3 @@ catch(e) {

try {
var result = yield r.expr(1).dbList("foo").run();
result = yield r.expr(1).dbList("foo").run();
}

@@ -199,4 +199,4 @@ catch(e) {

try {
var result = yield r.dbList().run();
var result = yield result.toArray();
result = yield r.dbList().run();
result = yield result.toArray();
assert(Array.isArray(result));

@@ -203,0 +203,0 @@

@@ -10,3 +10,3 @@ var config = require(__dirname+'/config.js');

var uuid = util.uuid;
var dbName, tableName;
var dbName, tableName, result;

@@ -29,4 +29,4 @@

try {
var result = yield r.db(dbName).tableList().run();
var result = yield result.toArray();
result = yield r.db(dbName).tableList().run();
result = yield result.toArray();
assert(Array.isArray(result));

@@ -44,3 +44,3 @@ done();

var result = yield r.db(dbName).tableCreate(tableName).run();
result = yield r.db(dbName).tableCreate(tableName).run();
assert.deepEqual(result, {created:1});

@@ -77,3 +77,3 @@

var result = yield r.db(dbName).tableCreate(tableName).run();
result = yield r.db(dbName).tableCreate(tableName).run();
assert.deepEqual(result, {created:1});

@@ -91,3 +91,3 @@

var result = yield r.db(dbName).tableCreate(tableName, {primaryKey: "foo"}).run();
result = yield r.db(dbName).tableCreate(tableName, {primaryKey: "foo"}).run();
assert.deepEqual(result, {created:1});

@@ -108,3 +108,3 @@

var result = yield r.db(dbName).tableCreate(tableName, {durability: "soft", primaryKey: "foo"}).run();
result = yield r.db(dbName).tableCreate(tableName, {durability: "soft", primaryKey: "foo"}).run();
assert.deepEqual(result, {created:1}); // We can't really check other parameters...

@@ -125,3 +125,3 @@

var result = yield r.db(dbName).tableCreate(tableName, {nonValidArg: true}).run();
result = yield r.db(dbName).tableCreate(tableName, {nonValidArg: true}).run();
}

@@ -139,3 +139,3 @@ catch(e) {

try {
var result = yield r.db(dbName).tableCreate().run();
result = yield r.db(dbName).tableCreate().run();
}

@@ -153,3 +153,3 @@ catch(e) {

try {
var result = yield r.db(dbName).tableCreate("-_-").run();
result = yield r.db(dbName).tableCreate("-_-").run();
}

@@ -168,3 +168,3 @@ catch(e) {

var result = yield r.db(dbName).tableCreate(tableName).run();
result = yield r.db(dbName).tableCreate(tableName).run();
assert.deepEqual(result, {created:1});

@@ -200,3 +200,3 @@

try {
var result = yield r.db(dbName).tableDrop().run();
result = yield r.db(dbName).tableDrop().run();
}

@@ -219,3 +219,3 @@ catch(e) {

var result = yield r.dbCreate(dbName).run();
result = yield r.dbCreate(dbName).run();
assert.deepEqual(result, {created: 1});

@@ -222,0 +222,0 @@

@@ -10,7 +10,7 @@ var config = require(__dirname+'/config.js');

var uuid = util.uuid;
var dbName, tableName;
var dbName, tableName, result;
It("`add` should work", function* (done) {
try {
var result = yield r.expr(1).add(1).run();
result = yield r.expr(1).add(1).run();
assert.equal(result, 2);

@@ -17,0 +17,0 @@

@@ -10,3 +10,3 @@ var config = require(__dirname+'/config.js');

var uuid = util.uuid;
var dbName, tableName;
var dbName, tableName, result, pks;

@@ -37,3 +37,3 @@ var options = {

try {
var result = yield r.expr(1).run()
result = yield r.expr(1).run()
assert.equal(result, 1);

@@ -52,3 +52,3 @@

try {
var result = yield [r.expr(1).run(), r.expr(1).run(), r.expr(1).run(), r.expr(1).run(), r.expr(1).run()]
result = yield [r.expr(1).run(), r.expr(1).run(), r.expr(1).run(), r.expr(1).run(), r.expr(1).run()]
assert.deepEqual(result, [1,1,1,1,1]);

@@ -69,3 +69,3 @@ assert(r.getPool().getLength() >= options.buffer+result.length);

try {
var result = yield [r.expr(1).run(), r.expr(1).run(), r.expr(1).run(), r.expr(1).run(), r.expr(1).run(), r.expr(1).run(), r.expr(1).run(), r.expr(1).run(), r.expr(1).run(), r.expr(1).run(), r.expr(1).run()]
result = yield [r.expr(1).run(), r.expr(1).run(), r.expr(1).run(), r.expr(1).run(), r.expr(1).run(), r.expr(1).run(), r.expr(1).run(), r.expr(1).run(), r.expr(1).run(), r.expr(1).run(), r.expr(1).run()]
assert.deepEqual(result, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1])

@@ -90,6 +90,6 @@ assert.equal(r.getPool().getLength(), options.max)

var result = yield r.dbCreate(dbName).run();
result = yield r.dbCreate(dbName).run();
assert.deepEqual(result, {created:1});
var result = yield r.db(dbName).tableCreate(tableName).run();
result = yield r.db(dbName).tableCreate(tableName).run();
assert.deepEqual(result, {created:1});

@@ -133,3 +133,3 @@

try {
var result = yield [r.db(dbName).table(tableName).run(),r.db(dbName).table(tableName).run(),r.db(dbName).table(tableName).run(),r.db(dbName).table(tableName).run(),r.db(dbName).table(tableName).run(),r.db(dbName).table(tableName).run(),r.db(dbName).table(tableName).run(),r.db(dbName).table(tableName).run(),r.db(dbName).table(tableName).run(),r.db(dbName).table(tableName).run()];
result = yield [r.db(dbName).table(tableName).run(),r.db(dbName).table(tableName).run(),r.db(dbName).table(tableName).run(),r.db(dbName).table(tableName).run(),r.db(dbName).table(tableName).run(),r.db(dbName).table(tableName).run(),r.db(dbName).table(tableName).run(),r.db(dbName).table(tableName).run(),r.db(dbName).table(tableName).run(),r.db(dbName).table(tableName).run()];
assert.equal(result.length, 10);

@@ -155,3 +155,3 @@ assert.equal(r.getPool().getAvailableLength(), 0);

var result = yield [r.expr(1).run(), r.expr(1).run(), r.expr(1).run(), r.expr(1).run(), r.expr(1).run(), r.expr(1).run(), r.expr(1).run(), r.expr(1).run(), r.expr(1).run(), r.expr(1).run()]
result = yield [r.expr(1).run(), r.expr(1).run(), r.expr(1).run(), r.expr(1).run(), r.expr(1).run(), r.expr(1).run(), r.expr(1).run(), r.expr(1).run(), r.expr(1).run(), r.expr(1).run()]

@@ -175,3 +175,3 @@ assert.deepEqual(result, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1])

var result = yield [r.expr(1).run(), r.expr(1).run(), r.expr(1).run(), r.expr(1).run(), r.expr(1).run(), r.expr(1).run(), r.expr(1).run(), r.expr(1).run(), r.expr(1).run(), r.expr(1).run()]
result = yield [r.expr(1).run(), r.expr(1).run(), r.expr(1).run(), r.expr(1).run(), r.expr(1).run(), r.expr(1).run(), r.expr(1).run(), r.expr(1).run(), r.expr(1).run(), r.expr(1).run()]

@@ -181,3 +181,3 @@ assert.deepEqual(result, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1])

// This query will make the error return an error -1
var result = yield r.expr(1).add(1).add(1).add(1).add(1).add(1).add(1).add(1)
result = yield r.expr(1).add(1).add(1).add(1).add(1).add(1).add(1).add(1)
.add(1).add(1).add(1).add(1).add(1).add(1).add(1).add(1).add(1).add(1)

@@ -184,0 +184,0 @@ .add(1).add(1).add(1).add(1).add(1).add(1).add(1).add(1).add(1).add(1)

@@ -11,3 +11,3 @@ var config = require(__dirname+'/config.js');

var uuid = util.uuid;
var dbName, tableName;
var dbName, tableName, result, pks;

@@ -20,6 +20,6 @@

var result = yield r.dbCreate(dbName).run();
result = yield r.dbCreate(dbName).run();
assert.deepEqual(result, {created:1});
var result = yield r.db(dbName).tableCreate(tableName).run();
result = yield r.db(dbName).tableCreate(tableName).run();
assert.deepEqual(result, {created:1});

@@ -40,3 +40,3 @@

try {
var result = yield r.db(dbName).info().run();
result = yield r.db(dbName).info().run();
assert.deepEqual(result, {name: dbName, type: "DB"});

@@ -53,3 +53,3 @@

try {
var result = yield r.db(dbName).table(tableName).info().run();
result = yield r.db(dbName).table(tableName).info().run();
assert.deepEqual(result, {db:{name: dbName,type:"DB"},indexes:[],name: tableName, primary_key:"id",type:"TABLE"})

@@ -98,3 +98,3 @@

try {
var result = yield r.db(dbName).table(tableName).get(pks[0]).run();
result = yield r.db(dbName).table(tableName).get(pks[0]).run();
assert.deepEqual(result, {id: pks[0]})

@@ -127,3 +127,3 @@

var table = r.db(dbName).table(tableName);
query = table.getAll.apply(table, pks);
var query = table.getAll.apply(table, pks);
result = yield query.run();

@@ -130,0 +130,0 @@ result = yield result.toArray();

@@ -10,3 +10,3 @@ var config = require(__dirname+'/config.js');

var uuid = util.uuid;
var dbName, tableName;
var dbName, tableName, result;

@@ -16,3 +16,3 @@

try {
var result = yield r.expr("hello").match("hello").run()
result = yield r.expr("hello").match("hello").run()
assert.deepEqual(result, {"end":5,"groups":[],"start":0,"str":"hello"});

@@ -40,3 +40,3 @@ done();

try {
var result = yield r.expr("helLo").upcase().run();
result = yield r.expr("helLo").upcase().run();
assert.equal(result, "HELLO");

@@ -51,3 +51,3 @@ done();

try {
var result = yield r.expr("HElLo").downcase().run();
result = yield r.expr("HElLo").downcase().run();
assert.equal(result, "hello");

@@ -54,0 +54,0 @@ done();

@@ -10,3 +10,3 @@ var config = require(__dirname+'/config.js');

var uuid = util.uuid;
var dbName, tableName;
var dbName, tableName, result, pks;

@@ -19,3 +19,3 @@

var result = yield r.dbCreate(dbName).run();
result = yield r.dbCreate(dbName).run();
assert.deepEqual(result, {created:1});

@@ -44,3 +44,3 @@

try {
var result = yield r.expr([1,2,3]).map(r.row).run();
result = yield r.expr([1,2,3]).map(r.row).run();
result = yield result.toArray();

@@ -61,3 +61,3 @@ assert.deepEqual(result, [1,2,3]);

try {
var result = yield r.expr([1,2,3]).map(function(doc) { return doc }).run();
result = yield r.expr([1,2,3]).map(function(doc) { return doc }).run();
result = yield result.toArray();

@@ -92,3 +92,3 @@ assert.deepEqual(result, [1,2,3]);

try {
var result = yield r.expr([{a: 0, b: 1, c: 2}, {a: 4, b: 4, c: 5}, {a:9, b:2, c:0}]).withFields("a").run();
result = yield r.expr([{a: 0, b: 1, c: 2}, {a: 4, b: 4, c: 5}, {a:9, b:2, c:0}]).withFields("a").run();
result = yield result.toArray();

@@ -105,3 +105,3 @@ assert.deepEqual(result, [{a: 0}, {a: 4}, {a: 9}]);

try {
var result = yield r.expr([{a: 0, b: 1, c: 2}, {a: 4, b: 4, c: 5}, {a:9, b:2, c:0}]).withFields("a", "c").run();
result = yield r.expr([{a: 0, b: 1, c: 2}, {a: 4, b: 4, c: 5}, {a:9, b:2, c:0}]).withFields("a", "c").run();
result = yield result.toArray();

@@ -131,3 +131,3 @@ assert.deepEqual(result, [{a: 0, c: 2}, {a: 4, c: 5}, {a:9, c:0}]);

try {
var result = yield r.expr([[1, 2], [3], [4]]).concatMap(function(doc) { return doc}).run();
result = yield r.expr([[1, 2], [3], [4]]).concatMap(function(doc) { return doc}).run();
result = yield result.toArray();

@@ -144,3 +144,3 @@ assert.deepEqual(result, [1, 2, 3, 4]);

try {
var result = yield r.expr([[1, 2], [3], [4]]).concatMap(r.row).run();
result = yield r.expr([[1, 2], [3], [4]]).concatMap(r.row).run();
result = yield result.toArray();

@@ -172,3 +172,3 @@ assert.deepEqual(result, [1, 2, 3, 4]);

try {
var result = yield r.expr([{a:23}, {a:10}, {a:0}, {a:100}]).orderBy("a").run();
result = yield r.expr([{a:23}, {a:10}, {a:0}, {a:100}]).orderBy("a").run();
result = yield result.toArray();

@@ -186,3 +186,3 @@ assert.deepEqual(result, [{a:0}, {a:10}, {a:23}, {a:100}]);

try {
var result = yield r.expr([{a:23}, {a:10}, {a:0}, {a:100}]).orderBy(r.row("a")).run();
result = yield r.expr([{a:23}, {a:10}, {a:0}, {a:100}]).orderBy(r.row("a")).run();
result = yield result.toArray();

@@ -200,5 +200,5 @@ assert.deepEqual(result, [{a:0}, {a:10}, {a:23}, {a:100}]);

try {
var result = yield r.db(dbName).table(tableName).orderBy({index: "id"}).run();
result = yield r.db(dbName).table(tableName).orderBy({index: "id"}).run();
result = yield result.toArray();
for(i=0; i<result.length-1; i++) {
for(var i=0; i<result.length-1; i++) {
assert(result[i].id < result[i+1].id);

@@ -215,5 +215,5 @@ }

try {
var result = yield r.db(dbName).table(tableName).orderBy({index: "val"}).run();
result = yield r.db(dbName).table(tableName).orderBy({index: "val"}).run();
result = yield result.toArray();
for(i=0; i<result.length-1; i++) {
for(var i=0; i<result.length-1; i++) {
assert(result[i].val < result[i+1].val);

@@ -233,3 +233,3 @@ }

var result = yield r.dbCreate(dbName).run();
result = yield r.dbCreate(dbName).run();
assert.deepEqual(result, {created: 1});

@@ -269,3 +269,3 @@

try {
var result = yield r.expr(1).desc("foo").run();
result = yield r.expr(1).desc("foo").run();
}

@@ -283,3 +283,3 @@ catch(e) {

try {
var result = yield r.expr(1).asc("foo").run();
result = yield r.expr(1).asc("foo").run();
}

@@ -298,3 +298,3 @@ catch(e) {

try {
var result = yield r.expr([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]).skip(3).run();
result = yield r.expr([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]).skip(3).run();
result = yield result.toArray();

@@ -325,3 +325,3 @@ assert.deepEqual(result, [3, 4, 5, 6, 7, 8, 9]);

try {
var result = yield r.expr([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]).limit(3).run();
result = yield r.expr([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]).limit(3).run();
result = yield result.toArray();

@@ -351,3 +351,3 @@ assert.deepEqual(result, [0, 1, 2]);

try {
var result = yield r.expr([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]).slice(3, 5).run();
result = yield r.expr([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]).slice(3, 5).run();
result = yield result.toArray();

@@ -364,3 +364,3 @@ assert.deepEqual(result, [3, 4]);

try {
var result = yield r.expr([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22, 23]).slice(5, 10, {rightBound:'closed'}).run();
result = yield r.expr([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22, 23]).slice(5, 10, {rightBound:'closed'}).run();
result = yield result.toArray();

@@ -406,3 +406,3 @@ assert.deepEqual(result, [5, 6, 7, 8, 9, 10]);

try {
var result = yield r.expr([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]).nth(3).run();
result = yield r.expr([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]).nth(3).run();
assert(result, 3);

@@ -431,3 +431,3 @@

try {
var result = yield r.expr([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]).nth(3).run();
result = yield r.expr([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]).nth(3).run();
assert(result, 3);

@@ -444,3 +444,3 @@

try {
var result = yield r.expr([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]).indexesOf(r.row.eq(3)).run();
result = yield r.expr([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]).indexesOf(r.row.eq(3)).run();
result = yield result.toArray();

@@ -457,3 +457,3 @@ assert.equal(result, 3);

try {
var result = yield r.expr([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]).indexesOf(function(doc) { return doc.eq(3)}).run();
result = yield r.expr([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]).indexesOf(function(doc) { return doc.eq(3)}).run();
result = yield result.toArray();

@@ -483,3 +483,3 @@ assert.equal(result, 3);

try {
var result = yield r.expr([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]).isEmpty().run();
result = yield r.expr([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]).isEmpty().run();
assert.equal(result, false);

@@ -499,3 +499,3 @@

try{
var result = yield r.expr([0, 1, 2]).union([3, 4, 5]).run();
result = yield r.expr([0, 1, 2]).union([3, 4, 5]).run();
result = yield result.toArray();

@@ -525,3 +525,3 @@ assert.deepEqual(result, [0, 1, 2, 3, 4, 5]);

try{
var result = yield r.expr([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]).sample(2).run();
result = yield r.expr([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]).sample(2).run();
result = yield result.toArray();

@@ -538,3 +538,3 @@ assert.equal(result.length, 2);

try{
var result = yield r.expr([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]).sample(-1).run();
result = yield r.expr([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]).sample(-1).run();
}

@@ -541,0 +541,0 @@ catch(e) {

@@ -10,3 +10,3 @@ var config = require(__dirname+'/config.js');

var uuid = util.uuid;
var dbName, tableName;
var dbName, tableName, result;

@@ -19,6 +19,6 @@

var result = yield r.dbCreate(dbName).run();
result = yield r.dbCreate(dbName).run();
assert.deepEqual(result, {created:1});
var result = yield r.db(dbName).tableCreate(tableName).run();
result = yield r.db(dbName).tableCreate(tableName).run();
assert.deepEqual(result, {created:1});

@@ -114,3 +114,3 @@

try {
var result = yield r.db(dbName).table(tableName).insert({}, {durability: "hard"}).run();
result = yield r.db(dbName).table(tableName).insert({}, {durability: "hard"}).run();
assert.equal(result.inserted, 1);

@@ -126,3 +126,3 @@

try {
var result = yield r.db(dbName).table(tableName).insert({}, {upsert: true}).run();
result = yield r.db(dbName).table(tableName).insert({}, {upsert: true}).run();
assert.equal(result.inserted, 1);

@@ -141,3 +141,3 @@

try {
var result = yield r.db(dbName).table(tableName).insert({}, {upsert: false}).run();
result = yield r.db(dbName).table(tableName).insert({}, {upsert: false}).run();
assert.equal(result.inserted, 1);

@@ -258,3 +258,3 @@

try {
var result = yield r.db(dbName).table(tableName).delete().run();
result = yield r.db(dbName).table(tableName).delete().run();
assert(result.deleted > 0);

@@ -274,3 +274,3 @@

try {
var result = yield r.db(dbName).table(tableName).delete().run();
result = yield r.db(dbName).table(tableName).delete().run();
assert(result);

@@ -301,3 +301,3 @@ result = yield r.db(dbName).table(tableName).insert({}).run();

try {
var result = yield r.db(dbName).table(tableName).delete().run();
result = yield r.db(dbName).table(tableName).delete().run();
assert(result);

@@ -338,3 +338,3 @@ result = yield r.db(dbName).table(tableName).insert({}).run();

try {
var result = yield r.db(dbName).table(tableName).delete().run();
result = yield r.db(dbName).table(tableName).delete().run();
assert(result);

@@ -359,3 +359,3 @@ result = yield r.db(dbName).table(tableName).insert({id: 1}).run();

try {
var result = yield r.db(dbName).table(tableName).delete().run();
result = yield r.db(dbName).table(tableName).delete().run();
assert(result);

@@ -382,3 +382,3 @@ result = yield r.db(dbName).table(tableName).insert([{id: 1}, {id: 2}]).run();

try {
var result = yield r.db(dbName).table(tableName).delete().run();
result = yield r.db(dbName).table(tableName).delete().run();
assert(result);

@@ -402,3 +402,3 @@ result = yield r.db(dbName).table(tableName).insert({id: 1}).run();

try {
var result = yield r.db(dbName).table(tableName).delete().run();
result = yield r.db(dbName).table(tableName).delete().run();
assert(result);

@@ -422,3 +422,3 @@ result = yield r.db(dbName).table(tableName).insert({id: 1}).run();

try {
var result = yield r.db(dbName).table(tableName).delete().run();
result = yield r.db(dbName).table(tableName).delete().run();
assert(result);

@@ -444,3 +444,3 @@ result = yield r.db(dbName).table(tableName).insert({id: 1}).run();

try {
var result = yield r.db(dbName).table(tableName).delete().run();
result = yield r.db(dbName).table(tableName).delete().run();
assert(result);

@@ -493,3 +493,3 @@ result = yield r.db(dbName).table(tableName).insert({id: 1}).run();

try {
var result = yield r.db(dbName).table(tableName).delete().run();
result = yield r.db(dbName).table(tableName).delete().run();
assert(result);

@@ -514,3 +514,3 @@ result = yield r.db(dbName).table(tableName).insert({id: 1}).run();

try {
var result = yield r.db(dbName).table(tableName).delete().run();
result = yield r.db(dbName).table(tableName).delete().run();
assert(result);

@@ -537,3 +537,3 @@ result = yield r.db(dbName).table(tableName).insert([{id: 1}, {id: 2}]).run();

try {
var result = yield r.db(dbName).table(tableName).delete().run();
result = yield r.db(dbName).table(tableName).delete().run();
assert(result);

@@ -557,3 +557,3 @@ result = yield r.db(dbName).table(tableName).insert({id: 1}).run();

try {
var result = yield r.db(dbName).table(tableName).delete().run();
result = yield r.db(dbName).table(tableName).delete().run();
assert(result);

@@ -577,3 +577,3 @@ result = yield r.db(dbName).table(tableName).insert({id: 1}).run();

try {
var result = yield r.db(dbName).table(tableName).delete().run();
result = yield r.db(dbName).table(tableName).delete().run();
assert(result);

@@ -599,3 +599,3 @@ result = yield r.db(dbName).table(tableName).insert({id: 1}).run();

try {
var result = yield r.db(dbName).table(tableName).delete().run();
result = yield r.db(dbName).table(tableName).delete().run();
assert(result);

@@ -602,0 +602,0 @@ result = yield r.db(dbName).table(tableName).insert({id: 1}).run();

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

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