Files
hatchet/pkg/repository/v1/sqlcv1/log_line.sql
Jishnu e82915b626 feat: add pagination support for V1LogLineList (#2354)
* feat: pagination for v1 loglines list

* add: sqlc v1 query for loglines count

* add: generated rest-client changes for python sdk

* refactor: frontend logs UI with pagination elements

* add: ts-sdk logline pagination, py logline list pagination docstring

* feat: add since queryparam for v1logline, add infinitescroll pagination on FE

* add custom polling for logs refresh on FE, remove inefficient default refresh logic

* add since queryparam of v1logline to all rest-clients

* refactor: remove offset query param, add until query param(v1logline)

* remove pagination from v1loglinelist

* fix: inconsistent scroll behaviour, add pagination response schema on v1loglist

* add: infinite scroll behavior for smooth log scrolling; prefetch next page logs in advance

* fix: pagination scroll, when task is running, remove stale pagination data when logs tab inactive

* chore: lint

* chore: lint

---------

Co-authored-by: mrkaye97 <mrkaye97@gmail.com>
2025-11-07 17:38:29 +01:00

36 lines
850 B
SQL

-- name: InsertLogLine :copyfrom
INSERT INTO v1_log_line (
tenant_id,
task_id,
task_inserted_at,
message,
metadata,
retry_count,
level
) VALUES (
$1,
$2,
$3,
$4,
$5,
$6,
$7
);
-- name: ListLogLines :many
SELECT
*
FROM
v1_log_line l
WHERE
l.tenant_id = @tenantId::UUID
AND l.task_id = @taskId::BIGINT
AND l.task_inserted_at = @taskInsertedAt::TIMESTAMPTZ
AND (sqlc.narg('search')::TEXT IS NULL OR l.message iLIKE concat('%', sqlc.narg('search')::TEXT, '%'))
AND (sqlc.narg('since')::TIMESTAMPTZ IS NULL OR l.created_at > sqlc.narg('since')::TIMESTAMPTZ)
AND (sqlc.narg('until')::TIMESTAMPTZ IS NULL OR l.created_at < sqlc.narg('until')::TIMESTAMPTZ)
ORDER BY
l.created_at ASC
LIMIT COALESCE(sqlc.narg('limit'), 1000)
OFFSET COALESCE(sqlc.narg('offset'), 0);