feat: Add streaming endpoint for workspace history (#157)

* feat: Add parameter querying to the API

* feat: Add streaming endpoint for workspace history

Enables a buildlog-like flow for reading job output.

* Fix empty parameter source and destination

* Add comment for usage of workspace history logs endpoint
This commit is contained in:
Kyle Carberry
2022-02-04 19:36:43 +00:00
committed by GitHub
parent 430341b7da
commit 65de6eef9c
22 changed files with 688 additions and 115 deletions
+12 -6
View File
@@ -188,14 +188,17 @@ FROM
WHERE
id = $1;
-- name: GetProjectHistoryLogsByIDBefore :many
-- name: GetProjectHistoryLogsByIDBetween :many
SELECT
*
FROM
project_history_log
WHERE
project_history_id = $1
AND created_at <= $2
project_history_id = @project_history_id
AND (
created_at >= @created_after
OR created_at <= @created_before
)
ORDER BY
created_at;
@@ -295,14 +298,17 @@ WHERE
LIMIT
1;
-- name: GetWorkspaceHistoryLogsByIDBefore :many
-- name: GetWorkspaceHistoryLogsByIDBetween :many
SELECT
*
FROM
workspace_history_log
WHERE
workspace_history_id = $1
AND created_at <= $2
workspace_history_id = @workspace_history_id
AND (
created_at >= @created_after
OR created_at <= @created_before
)
ORDER BY
created_at;