Permalink
Browse files

Merge pull request #8 from omg/master

Use LIMIT...OFFSET syntax understood both by MySQL and PG.
  • Loading branch information...
2 parents e5dcaf2 + 6f19a04 commit dcb12f7715bd8bb2ca2557e4a7ce500e424e3129 @robconery robconery committed Mar 11, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/query.js
View
@@ -21,7 +21,7 @@ var Query = function(sql, params, table) {
};
self.limit = function(count, offset) {
- return _.isUndefined(offset) ? self._append(" \nLIMIT %d", count) : self._append(" \nLIMIT(%d,%d)", count, offset);
+ return _.isUndefined(offset) ? self._append(" \nLIMIT %d", count) : self._append(" \nLIMIT %d OFFSET %d", count, offset);
};
self.raiseError = function(err) {

0 comments on commit dcb12f7

Please sign in to comment.