Comparing version 0.4.1 to 0.4.2
@@ -177,3 +177,11 @@ (function(exports) { | ||
and: function( wh ) { | ||
return this.where( wh, 'AND' ); | ||
}, | ||
or: function( wh ) { | ||
return this.where( wh, 'OR' ); | ||
}, | ||
/** | ||
@@ -507,4 +515,2 @@ */ | ||
if( typeof module !== "undefined" && module.exports ) { | ||
@@ -511,0 +517,0 @@ module.exports = monologue; |
{ | ||
"name": "monologue", | ||
"version": "0.4.1", | ||
"version": "0.4.2", | ||
"description": "Streamlined MySQL query building", | ||
@@ -5,0 +5,0 @@ "main": "./monologue.js", |
@@ -6,2 +6,6 @@ Monologue - Streamlined query building | ||
**Cool New Features** | ||
2 convenience functions, .and() and .or(), where added allowing you to avoid the somewhat awkward interface of .where() (passing "AND" or "OR" as the second param). These methods can be used out of order just like any other, they are essentially just aliases to .where() that handle the "AND"/"OR" for you. | ||
**Breaking Change** | ||
@@ -49,5 +53,5 @@ | ||
.where( { "id": [1,2,3,4,5,6] } ) // alternative to where("id").in([...]) | ||
.where( 'date_time' ).between( '2012-09-12', '2013-01-20') | ||
.and( 'date_time' ).between( '2012-09-12', '2013-01-20') | ||
.group( ['type', 'hamster' ] ) | ||
.where( "name", "OR" ).like("ro%en") // out of order, also passing "OR" as separator | ||
.or( "name" ).like("ro%en") // out of order, also passing "OR" as separator | ||
.order( "id" ) | ||
@@ -54,0 +58,0 @@ .limit( '300', 1000 ) |
16317
385
154