forked from vieter-v/vieter
WIP: BuildLogFilter
parent
0233b8559d
commit
febefe26d1
|
|
@ -1,11 +1,11 @@
|
||||||
module db
|
module db
|
||||||
|
|
||||||
import models { BuildLog }
|
import models { BuildLog, BuildLogFilter }
|
||||||
|
|
||||||
// get_build_logs returns all BuildLog's in the database.
|
// get_build_logs returns all BuildLog's in the database.
|
||||||
pub fn (db &VieterDb) get_build_logs() []BuildLog {
|
pub fn (db &VieterDb) get_build_logs(filter BuildLogFilter) []BuildLog {
|
||||||
res := sql db.conn {
|
res := sql db.conn {
|
||||||
select from BuildLog order by id
|
select from BuildLog where filter.repo == 0 || repo_id == filter.repo order by id
|
||||||
}
|
}
|
||||||
|
|
||||||
return res
|
return res
|
||||||
|
|
|
||||||
|
|
@ -26,3 +26,13 @@ pub fn (bl &BuildLog) str() string {
|
||||||
|
|
||||||
return str
|
return str
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[params]
|
||||||
|
pub struct BuildLogFilter {
|
||||||
|
pub mut:
|
||||||
|
repo int
|
||||||
|
before time.Time
|
||||||
|
after time.Time
|
||||||
|
failed_only bool
|
||||||
|
arch string
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue