Permalink
Browse files

Use LIMIT...OFFSET syntax understood both by MySQL and PG.

  • Loading branch information...
omg committed Feb 27, 2013
1 parent e5dcaf2 commit 6f19a040fcb098dee6868333391c5e42319796e9
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 6f19a04

Please sign in to comment.