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

downstairs

Package Overview
Dependencies
Maintainers
2
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

downstairs - npm Package Compare versions

Comparing version 0.2.2 to 0.2.3

docs/docco.css

13

config/defaults.json

@@ -6,3 +6,3 @@ {

"port": "5432",
"user": "damien",
"user": "nicholas",
"password": null,

@@ -16,16 +16,7 @@ "name": "downstairs_development"

"port": "5432",
"user": "damien",
"user": "nicholas",
"password": null,
"name": "downstairs_test"
}
},
"production": {
"database": {
"host": "localhost",
"port": "5432",
"user": "damien",
"password": null,
"name": "downstairs_production"
}
}
}

@@ -49,2 +49,3 @@ var Table = {}

}
return sqlBaseQuery;

@@ -80,2 +81,17 @@ }

if (conditions && conditions.queryParameters){
if (conditions.queryParameters.limit){
sqlStr.text = sqlStr.text + " LIMIT " + conditions.queryParameters['limit'];
}
// if (conditions.queryParameters.offset){
// sqlStr.text = sqlStr.text + " OFFSET " + conditions.queryParameters['offset'];
// }
// if (conditions.queryParameters.orderBy){
// sqlStr.text = sqlStr.text + " ORDER BY " + conditions.queryParameters['orderBy'];
// }
}
var _self = this;

@@ -82,0 +98,0 @@ var _cb = cb;

{
"name": "downstairs",
"description": "A light ORM wrapped about brianc's node-sql and node-pg",
"version": "0.2.2",
"version": "0.2.3",
"homepage": "https://github.com/moneytribeaustralia/downstairs.js",

@@ -6,0 +6,0 @@ "author": {

@@ -14,3 +14,3 @@ var pg = require('pg')

var blueprint =
var userBlueprint =
{User: {

@@ -24,3 +24,3 @@ email: function(){ return faker2.Internet.email()}

ctx.add(blueprint);
ctx.add(userBlueprint);

@@ -64,9 +64,11 @@ exports.ectypes = ctx;

exports.repeatableSQL = "CREATE TABLE repeatables\
(\
id serial NOT NULL,\
name character varying(100)\
);"
var defaultConnection = new Connection.PostgreSQL(env.connectionString);
exports.defaultConnection = defaultConnection;
// exports.resetConnection = function(){
// Downstairs.connections = {};
// Downstairs.add(defaultConnection);
// }

@@ -256,3 +256,55 @@ var Downstairs = require('../lib/downstairs')

});
});
var repeatableSchema = sql.Table.define({
name: 'repeatables'
, quote: true
, schema: 'public'
, columns: ['id'
, 'name']
});
var Repeatable = Table.model('Repeatable', repeatableSchema);
describe('node-sql augmentations', function(done){
beforeEach(function(done){
helper.resetDb(helper.repeatableSQL, done);
})
var firstRepeatable, secondRepeatable, thirdRepeatable;
beforeEach(function(done){
Repeatable.create({name: 'blue'}, function(err, repeatable){
firstRepeatable = repeatable;
Repeatable.create({name: 'blue'}, function(err, repeatable){
secondRepeatable = repeatable;
Repeatable.create({name: 'blue'}, function(err, repeatable){
thirdRepeatable = repeatable;
// Repeatable.findAll({}, function(err, repeatables){
// console.log(repeatables.length, " <<<<<");
// })
done();
})
})
})
})
it('parses limit in queryParameters of conditions', function(done) {
var data = {queryParameters: { limit: 2 } };
Repeatable.findAll(data, function(err, repeatables){
repeatables.length.should.equal(2); //if it's 3, we have an error with limit
done();
});
});
// it('parses offset in queryParameters of conditions', function(done) {
// var data = { queryParameters: { offset: 2 } };
// Repeatable.findAll(data, function(err, repeatables){
// repeatables.length.should.equal(1); //if it's 3, we have an error with limit
// repeatables[0].id.should.equal(thirdRepeatable.id);
// done();
// });
// });
});
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