Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Added a unit test to make sure LIMIT and OFFSET are playing together …
…nice on TDS.
  • Loading branch information
rdhammond committed Aug 9, 2013
commit eeebd796d3d5dc193dfe635dade6a42c79457e1c
5 changes: 5 additions & 0 deletions test/integration/test-limit-offset-tds.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,8 @@ assert.equal(
common.Select('tds').from('table1').offset('123').limit('456').build(),
"SELECT TOP 456 * FROM ( SELECT ROW_NUMBER() OVER (ORDER BY id ASC) AS p_RN, * FROM [table1] ) SQ WHERE p_RN > 123"
);

assert.equal(
common.Select('tds').from('table1').offset('123').limit('456').order('col1').order('col2', 'Z').build(),
"SELECT TOP 456 * FROM ( SELECT ROW_NUMBER() OVER (ORDER BY [col1] ASC, [col2] DESC) AS p_RN, * FROM [table1] ) SQ WHERE p_RN > 123 ORDER BY [col1] ASC, [col2] DESC"
);