Skip to content
This repository was archived by the owner on May 13, 2025. It is now read-only.

Commit 1c92264

Browse files
authored
fix: footer count query fix (#398)
1 parent a10b2ed commit 1c92264

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/hooks/useQueryResult.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ export const useFetchCount = () => {
6868
const defaultQuery = `select count(*) as count from \"${currentStream}\"`;
6969
const query = (() => {
7070
if (isQuerySearchActive) {
71-
const finalQuery = custSearchQuery.replace(/SELECT[\s\S]*?FROM/i, 'SELECT COUNT(*) as count FROM');
71+
const finalQuery = `WITH user_query_count as ( ${custSearchQuery} )SELECT count(*) as count from user_query_count`;
72+
7273
if (activeMode === 'filters') {
7374
const { where } = parseQuery('Parseable', appliedQuery, '');
7475
const finalQuery = defaultQuery + ' ' + 'where' + ' ' + where;

0 commit comments

Comments
 (0)