sqlquerybuilder
Advanced tools
Comparing version 0.0.43 to 0.0.44
{ | ||
"name": "sqlquerybuilder", | ||
"version": "0.0.43", | ||
"version": "0.0.44", | ||
"description": "Highly opinionated Sql Server Query Writer, mostly for internal use.", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index", |
@@ -49,2 +49,10 @@ /** | ||
//SELECT OBJ W/ NULLS | ||
it('passing an object into select should produce valid sql with null aliases', function(done){ | ||
var obj = {Id: 'TicketId', EmployeeNumber: null, Name: null}; | ||
(sqlBuilder().select(obj).from("Tickets").join("Leases").build()).should.equal("SELECT Id AS 'TicketId', EmployeeNumber, Name FROM Tickets " + | ||
"JOIN Leases ON Tickets.Lease_id = Leases.Id "); | ||
done(); | ||
}); | ||
//SELECT STRING W/ ALIASES | ||
@@ -76,3 +84,3 @@ it('passing a string with aliases into select should work', function(done){ | ||
}); | ||
it('should chain selects', function(done){ | ||
it('should chain selects with selectJoin first', function(done){ | ||
sqlBuilder().from('main') | ||
@@ -79,0 +87,0 @@ .selectJoin({'main.Id':'Id', 'secondary.Id': 'secondary.Id'}) |
215883
4528