Skip to content
This repository has been archived by the owner on Mar 4, 2019. It is now read-only.

Commit

Permalink
Merge pull request #8 from omg/master
Browse files Browse the repository at this point in the history
Use LIMIT...OFFSET syntax understood both by MySQL and PG.
  • Loading branch information
robconery committed Mar 11, 2013
2 parents e5dcaf2 + 6f19a04 commit dcb12f7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/query.js
Expand Up @@ -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) {
Expand Down

0 comments on commit dcb12f7

Please sign in to comment.