We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
GitLabConfig::count_for_crate()
1 parent b1e6551 commit abcadb5Copy full SHA for abcadb5
crates/crates_io_database/src/models/trustpub/gitlab_config.rs
@@ -17,6 +17,16 @@ pub struct GitLabConfig {
17
pub environment: Option<String>,
18
}
19
20
+impl GitLabConfig {
21
+ pub async fn count_for_crate(conn: &mut AsyncPgConnection, crate_id: i32) -> QueryResult<i64> {
22
+ trustpub_configs_gitlab::table
23
+ .filter(trustpub_configs_gitlab::crate_id.eq(crate_id))
24
+ .count()
25
+ .get_result(conn)
26
+ .await
27
+ }
28
+}
29
+
30
#[derive(Debug, Insertable)]
31
#[diesel(table_name = trustpub_configs_gitlab, check_for_backend(diesel::pg::Pg))]
32
pub struct NewGitLabConfig<'a> {
0 commit comments