mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
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:
+12
-6
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user