sqrolls
Advanced tools
Comparing version 0.3.0 to 0.4.0
@@ -41,2 +41,16 @@ import { PredicateBaseBuilder } from './basebuilders'; | ||
/** | ||
* Sets a limit on the select query if predicate is true | ||
* | ||
* @param val The result set limit | ||
* @param check The conditional check | ||
*/ | ||
limitIf(val: number, check: boolean): Select; | ||
/** | ||
* Sets an offset on the select query | ||
* | ||
* @param val The result set offset | ||
* @param check The conditional check | ||
*/ | ||
offsetIf(val: number, check: boolean): Select; | ||
/** | ||
* Builds the final select statement. | ||
@@ -43,0 +57,0 @@ */ |
@@ -60,2 +60,26 @@ "use strict"; | ||
/** | ||
* Sets a limit on the select query if predicate is true | ||
* | ||
* @param val The result set limit | ||
* @param check The conditional check | ||
*/ | ||
limitIf(val, check) { | ||
if (check) { | ||
this.limit(val); | ||
} | ||
return this; | ||
} | ||
/** | ||
* Sets an offset on the select query | ||
* | ||
* @param val The result set offset | ||
* @param check The conditional check | ||
*/ | ||
offsetIf(val, check) { | ||
if (check) { | ||
this.offset(val); | ||
} | ||
return this; | ||
} | ||
/** | ||
* Builds the final select statement. | ||
@@ -62,0 +86,0 @@ */ |
{ | ||
"name": "sqrolls", | ||
"version": "0.3.0", | ||
"version": "0.4.0", | ||
"description": "sql builder library", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
21285
634