summaryrefslogtreecommitdiffstats
path: root/src/commands/db.rs
diff options
context:
space:
mode:
authorMatthias Beyer <matthias.beyer@atos.net>2021-06-07 14:21:40 +0200
committerMatthias Beyer <matthias.beyer@atos.net>2021-06-07 15:38:53 +0200
commit037275412fb72a27c8bb0347d047e1a2b65e0569 (patch)
tree2296221f6d1a5e29f98662b90525053ad130af6c /src/commands/db.rs
parent8f9c7d77acfa16ebe9660eba113fbebd68b96eed (diff)
Add endpoint filtering in "db jobs" subcommand
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
Diffstat (limited to 'src/commands/db.rs')
-rw-r--r--src/commands/db.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/commands/db.rs b/src/commands/db.rs
index 4ece20a..a296579 100644
--- a/src/commands/db.rs
+++ b/src/commands/db.rs
@@ -457,6 +457,10 @@ fn jobs(conn_cfg: DbConnectionConfig<'_>, matches: &ArgMatches) -> Result<()> {
sel = sel.limit(limit)
}
+ if let Some(ep_name) = matches.value_of("endpoint") {
+ sel = sel.filter(schema::endpoints::name.eq(ep_name))
+ }
+
let data = sel
.order_by(schema::jobs::id.desc()) // required for the --limit implementation
.load::<(models::Job, models::Submit, models::Endpoint, models::Package)>(&conn)?