From 55ed9f337ae0cf8e1336448d6b4273b3ee31aca2 Mon Sep 17 00:00:00 2001 From: iximeow Date: Tue, 27 Jun 2023 01:47:29 -0700 Subject: [api] artifacts/ now supports streaming in-progress artifacts back out as they are provided --- src/sql.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/sql.rs') diff --git a/src/sql.rs b/src/sql.rs index 6e0141a..f5ae731 100644 --- a/src/sql.rs +++ b/src/sql.rs @@ -84,7 +84,9 @@ pub const CREATE_ARTIFACTS_TABLE: &'static str = "\ CREATE TABLE IF NOT EXISTS artifacts (id INTEGER PRIMARY KEY AUTOINCREMENT, job_id INTEGER, name TEXT, - desc TEXT);"; + desc TEXT, + created_time INTEGER, + completed_time INTEGER);"; pub const CREATE_REMOTES_INDEX: &'static str = "\ CREATE INDEX IF NOT EXISTS 'repo_to_remote' ON remotes(repo_id);"; @@ -98,6 +100,9 @@ pub const PENDING_JOBS: &'static str = "\ pub const LAST_ARTIFACTS_FOR_JOB: &'static str = "\ select * from artifacts where job_id=?1 and (name like \"%(stderr)%\" or name like \"%(stdout)%\") order by id desc limit 2;"; +pub const ARTIFACT_BY_ID: &'static str = "\ + select * from artifacts where id=?1 and job_id=?2;"; + pub const METRICS_FOR_JOB: &'static str = "\ select * from metrics where job_id=?1 order by id asc;"; -- cgit v1.1