forked from vieter-v/vieter
feat(server): allow filtering of builds per repo
This commit is contained in:
parent
7e01dbafec
commit
393e641a76
2 changed files with 22 additions and 6 deletions
|
|
@ -4,7 +4,7 @@ import time
|
|||
|
||||
pub struct BuildLog {
|
||||
id int [primary; sql: serial]
|
||||
repo GitRepo [nonull]
|
||||
repo_id int [nonull]
|
||||
start_time time.Time [nonull]
|
||||
end_time time.Time [nonull]
|
||||
exit_code int [nonull]
|
||||
|
|
@ -19,6 +19,16 @@ pub fn (db &VieterDb) get_build_logs() []BuildLog {
|
|||
return res
|
||||
}
|
||||
|
||||
// get_build_logs_for_repo returns all BuildLog's in the database for a given
|
||||
// repo.
|
||||
pub fn (db &VieterDb) get_build_logs_for_repo(repo_id int) []BuildLog {
|
||||
res := sql db.conn {
|
||||
select from BuildLog where repo_id == repo_id order by id
|
||||
}
|
||||
|
||||
return res
|
||||
}
|
||||
|
||||
// get_build_log tries to return a specific BuildLog.
|
||||
pub fn (db &VieterDb) get_build_log(id int) ?BuildLog {
|
||||
res := sql db.conn {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue