diff options
author | Matthias Beyer <matthias.beyer@atos.net> | 2021-06-07 14:21:40 +0200 |
---|---|---|
committer | Matthias Beyer <matthias.beyer@atos.net> | 2021-06-07 15:38:53 +0200 |
commit | 037275412fb72a27c8bb0347d047e1a2b65e0569 (patch) | |
tree | 2296221f6d1a5e29f98662b90525053ad130af6c /src/commands/db.rs | |
parent | 8f9c7d77acfa16ebe9660eba113fbebd68b96eed (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.rs | 4 |
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)? |