Skip to content

Commit 92f5517

Browse files
committed
Fix pagination for Show Table Records
1 parent 50c52be commit 92f5517

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/ls/queries.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,11 @@ const treeFunctionFilter = function(p: { [key: string]: any }): string {
9292
}
9393

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

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

0 commit comments

Comments
 (0)