Comparing version 0.2.0 to 0.3.0
@@ -8,2 +8,4 @@ import { PredicateBaseBuilder } from './basebuilders'; | ||
private orderByCol?; | ||
private _limit?; | ||
private _offset?; | ||
private constructor(); | ||
@@ -28,2 +30,14 @@ static builder(): Select; | ||
/** | ||
* Sets a limit on the select query | ||
* | ||
* @param val The result set limit | ||
*/ | ||
limit(val: number): Select; | ||
/** | ||
* Sets an offset on the select query | ||
* | ||
* @param val The result set offset | ||
*/ | ||
offset(val: number): Select; | ||
/** | ||
* Builds the final select statement. | ||
@@ -30,0 +44,0 @@ */ |
@@ -42,2 +42,20 @@ "use strict"; | ||
/** | ||
* Sets a limit on the select query | ||
* | ||
* @param val The result set limit | ||
*/ | ||
limit(val) { | ||
this._limit = val; | ||
return this; | ||
} | ||
/** | ||
* Sets an offset on the select query | ||
* | ||
* @param val The result set offset | ||
*/ | ||
offset(val) { | ||
this._offset = val; | ||
return this; | ||
} | ||
/** | ||
* Builds the final select statement. | ||
@@ -57,2 +75,8 @@ */ | ||
} | ||
if (this._limit) { | ||
stmt += ' LIMIT ' + this._limit; | ||
} | ||
if (this._offset) { | ||
stmt += ' OFFSET ' + this._offset; | ||
} | ||
return [stmt, args]; | ||
@@ -59,0 +83,0 @@ } |
{ | ||
"name": "sqrolls", | ||
"version": "0.2.0", | ||
"version": "0.3.0", | ||
"description": "sql builder library", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
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
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
20332
596