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

Function get_for_application_id

chirpstack/src/storage/tenant.rs:217–227  ·  view source on GitHub ↗
(app_id: Uuid)

Source from the content-addressed store, hash-verified

215}
216
217pub async fn get_for_application_id(app_id: Uuid) -> Result<Tenant, Error> {
218 let t = tenant::dsl::tenant
219 .inner_join(application::table.on(application::tenant_id.eq(tenant::id)))
220 .select(tenant::all_columns)
221 .filter(application::id.eq(fields::Uuid::from(app_id)))
222 .first(&mut get_async_db_conn().await?)
223 .await
224 .map_err(|e| Error::from_diesel(e, app_id.to_string()))?;
225
226 Ok(t)
227}
228
229pub async fn update(t: Tenant) -> Result<Tenant, Error> {
230 t.validate()?;

Callers 1

create_deploymentMethod · 0.85

Calls 2

to_stringMethod · 0.80
get_async_db_connFunction · 0.70

Tested by

no test coverage detected