MCPcopy Create free account
hub / github.com/chirpstack/chirpstack / get_count

Function get_count

chirpstack/src/storage/api_key.rs:76–87  ·  view source on GitHub ↗
(filters: &Filters)

Source from the content-addressed store, hash-verified

74}
75
76pub async fn get_count(filters: &Filters) -> Result<i64, Error> {
77 let mut q = api_key::dsl::api_key
78 .select(dsl::count_star())
79 .filter(api_key::dsl::is_admin.eq(filters.is_admin))
80 .into_boxed();
81
82 if let Some(tenant_id) = &filters.tenant_id {
83 q = q.filter(api_key::dsl::tenant_id.eq(fields::Uuid::from(tenant_id)));
84 }
85
86 Ok(q.first(&mut get_async_db_conn().await?).await?)
87}
88
89pub async fn list(limit: i64, offset: i64, filters: &Filters) -> Result<Vec<ApiKey>, Error> {
90 let mut q = api_key::dsl::api_key

Callers 1

api_keyFunction · 0.70

Calls 1

get_async_db_connFunction · 0.70

Tested by

no test coverage detected