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

Function list

chirpstack/src/storage/api_key.rs:89–105  ·  view source on GitHub ↗
(limit: i64, offset: i64, filters: &Filters)

Source from the content-addressed store, hash-verified

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
91 .filter(api_key::dsl::is_admin.eq(filters.is_admin))
92 .into_boxed();
93
94 if let Some(tenant_id) = &filters.tenant_id {
95 q = q.filter(api_key::dsl::tenant_id.eq(fields::Uuid::from(tenant_id)));
96 }
97
98 let items = q
99 .order_by(api_key::dsl::name)
100 .limit(limit)
101 .offset(offset)
102 .load(&mut get_async_db_conn().await?)
103 .await?;
104 Ok(items)
105}
106
107#[cfg(test)]
108pub mod test {

Callers 1

api_keyFunction · 0.70

Calls 1

get_async_db_connFunction · 0.70

Tested by

no test coverage detected