Skip to content

Commit

Permalink
Merge branch 'hotfix/totalcount' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
altergui committed Aug 9, 2024
2 parents e9744d3 + fc1d81e commit 87951d8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 4 additions & 3 deletions vochain/indexer/db/processes.sql.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions vochain/indexer/queries/processes.sql
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,13 @@ SELECT COUNT(DISTINCT entity_id) FROM processes;

-- name: SearchEntities :many
WITH results AS (
SELECT *,
COUNT(*) OVER() AS total_count
SELECT *
FROM processes
WHERE (sqlc.arg(entity_id_substr) = '' OR (INSTR(LOWER(HEX(entity_id)), sqlc.arg(entity_id_substr)) > 0))
)
SELECT entity_id, COUNT(id) AS process_count, total_count
SELECT entity_id,
COUNT(id) AS process_count,
COUNT(entity_id) OVER() AS total_count
FROM results
GROUP BY entity_id
ORDER BY creation_time DESC, id ASC
Expand Down

0 comments on commit 87951d8

Please sign in to comment.