diff options
Diffstat (limited to 'src/commands/db.rs')
-rw-r--r-- | src/commands/db.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/commands/db.rs b/src/commands/db.rs index f3a6721..38f4beb 100644 --- a/src/commands/db.rs +++ b/src/commands/db.rs @@ -341,6 +341,7 @@ fn submits(conn_cfg: DbConnectionConfig<'_>, matches: &ArgMatches) -> Result<()> let query = schema::submits::table .order_by(schema::submits::id.desc()) // required for the --limit implementation .inner_join(schema::githashes::table.on(schema::submits::repo_hash_id.eq(schema::githashes::id))) + .inner_join(schema::images::table) .into_boxed(); let query = if let Some(commithash) = commit.as_ref() { @@ -349,6 +350,12 @@ fn submits(conn_cfg: DbConnectionConfig<'_>, matches: &ArgMatches) -> Result<()> query }; + let query = if let Some(image) = matches.value_of("image") { + query.filter(schema::images::name.eq(image)) + } else { + query + }; + let submits = if let Some(pkgname) = matches.value_of("with_pkg").map(String::from) { // Get all submits which included the package, but were not necessarily made _for_ the package let query = query |