downstairs
Advanced tools
Comparing version 0.3.8 to 0.3.9
{ | ||
"development": { | ||
"database": { | ||
"host": "localhost", | ||
"port": "5432", | ||
"user": "kristian", | ||
"password": null, | ||
"name": "downstairs_development" | ||
} | ||
}, | ||
"test": { | ||
"database": { | ||
"host": "localhost", | ||
"port": "5432", | ||
"user": "kristian", | ||
"password": null, | ||
"name": "downstairs_test" | ||
} | ||
}, | ||
"production": { | ||
"database": { | ||
"host": "localhost", | ||
"port": "5432", | ||
"user": "kristian", | ||
"password": null, | ||
"name": "downstairs_production" | ||
} | ||
} | ||
"development": { | ||
"database": { | ||
"host": "localhost", | ||
"port": "5432", | ||
"user": "postgres", | ||
"password": null, | ||
"name": "downstairs_development" | ||
} | ||
}, | ||
"test": { | ||
"database": { | ||
"host": "localhost", | ||
"port": "5432", | ||
"user": "postgres", | ||
"password": null, | ||
"name": "downstairs_test" | ||
} | ||
}, | ||
"production": { | ||
"database": { | ||
"host": "localhost", | ||
"port": "5432", | ||
"user": "postgres", | ||
"password": null, | ||
"name": "downstairs_production" | ||
} | ||
} | ||
} |
@@ -274,2 +274,6 @@ var Adapter = function(){} | ||
} | ||
else if (Array.isArray(conditions[key]) ) { | ||
var clause = Model.schema[key].in(conditions[key]); | ||
clauses.push(clause); | ||
} | ||
else if (conditions[key]) { | ||
@@ -276,0 +280,0 @@ var clause = Model.schema[key].equals(conditions[key]); |
{ | ||
"name": "downstairs", | ||
"description": "A light ORM wrapped about brianc's node-sql and node-pg", | ||
"version": "0.3.8", | ||
"version": "0.3.9", | ||
"homepage": "https://github.com/moneytribeaustralia/downstairs.js", | ||
@@ -6,0 +6,0 @@ "author": { |
@@ -98,3 +98,3 @@ [![Build Status](https://secure.travis-ci.org/moneytribeaustralia/downstairs.js.png)](http://travis-ci.org/moneytribeaustralia/downstairs.js) | ||
User.findAll({ like: {name: 'fre%', surname: 'jon%'} }); | ||
# This finds all uses with a name that starts with 'fre' and a surname that starts with 'jon' | ||
# This finds all users with a name that starts with 'fre' and a surname that starts with 'jon' | ||
@@ -104,2 +104,4 @@ User.findAll({ queryParameters: {limit: 6, orderBy: 'name ASC' } } }); | ||
User.findAll({ name: [ 'Fred', 'Mary'] }); | ||
# This finds all users named Fred and Mary. | ||
``` | ||
@@ -106,0 +108,0 @@ |
@@ -105,3 +105,39 @@ var Downstairs = require('../lib/downstairs') | ||
it('finds a record with a in () condition', function(done) { | ||
var User = Collection.model('User', helper.userConfig, null, "testdb"); | ||
var data = {password: '5f4dcc3b5aa765d61d8327deb882cf99', username: 'fred', email: 'fred@moneytribe.com.au'}; | ||
ectypes.User.create(data, function(err, results) { | ||
data.username = 'mary'; | ||
data.email = 'mary@moneytribe.com.au' | ||
ectypes.User.create(data, function(err, results) { | ||
User.findAll({ username: [ 'fred', 'mary' ], queryParameters: {orderBy: 'username'}} , function(err, users){ | ||
should.exist(users); | ||
users.should.have.lengthOf(2) | ||
users[0].username.should.equal('fred'); | ||
users[1].username.should.equal('mary'); | ||
done(); | ||
}); | ||
}); | ||
}); | ||
}); | ||
it('finds a record with two x IN() conditions', function(done) { | ||
var User = Collection.model('User', helper.userConfig, null, "testdb"); | ||
var data = {password: '5f4dcc3b5aa765d61d8327deb882cf99', username: 'fred', email: 'fred@moneytribe.com.au'}; | ||
ectypes.User.create(data, function(err, results) { | ||
data.username = 'mary'; | ||
data.email = 'mary@moneytribe.com.au' | ||
ectypes.User.create(data, function(err, results) { | ||
User.findAll({ username: [ 'fred', 'mary' ], email: [ 'fred@moneytribe.com.au', 'mary@moneytribe.com.au' ], queryParameters: {orderBy: 'username'}} , function(err, users){ | ||
should.exist(users); | ||
users.should.have.lengthOf(2) | ||
users[0].username.should.equal('fred'); | ||
users[1].username.should.equal('mary'); | ||
done(); | ||
}); | ||
}); | ||
}); | ||
}); | ||
it('finds a record with a where JSON condition including a null field', function(done) { | ||
@@ -108,0 +144,0 @@ var User = Collection.model('User', helper.userConfig, null, "testdb"); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
73915
33
1949
172
1