Skip to content

Commit 4841a70

Browse files
Merge pull request #54 from gjsjohnmurray/crimson-marlin
Fix pagination for `Show Table Records`
2 parents 7dbc9f1 + 357eea9 commit 4841a70

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/ls/queries.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,11 @@ const treeFunctionFilter = function(p: { [key: string]: any }): string {
9393
}
9494

9595
const fetchRecords: IQueries['fetchRecords'] = queryFactory`
96-
SELECT TOP ${p => p.limit || 50} *
97-
FROM ${p => p.table.schema}.${p => (p.table.label || p.table)}
96+
SELECT * FROM (
97+
SELECT TOP ALL *
98+
FROM ${p => p.table.schema}.${p => (p.table.label || p.table)}
99+
)
100+
WHERE %vid BETWEEN ${p => (p.offset || 0) + 1} AND ${p => ((p.offset || 0) + (p.limit || 50))}
98101
`;
99102

100103
const countRecords: IQueries['countRecords'] = queryFactory`

0 commit comments

Comments
 (0)