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

Function get_all_device_data

chirpstack/src/storage/helpers.rs:11–23  ·  view source on GitHub ↗
(
    dev_eui: EUI64,
)

Source from the content-addressed store, hash-verified

9use lrwn::EUI64;
10
11pub async fn get_all_device_data(
12 dev_eui: EUI64,
13) -> Result<(Device, Application, Tenant, DeviceProfile), Error> {
14 let res = device::table
15 .inner_join(application::table)
16 .inner_join(tenant::table.on(application::dsl::tenant_id.eq(tenant::dsl::id)))
17 .inner_join(device_profile::table)
18 .filter(device::dsl::dev_eui.eq(&dev_eui))
19 .first::<(Device, Application, Tenant, DeviceProfile)>(&mut get_async_db_conn().await?)
20 .await
21 .map_err(|e| Error::from_diesel(e, dev_eui.to_string()))?;
22 Ok(res)
23}

Callers 7

get_device_dataMethod · 0.85
get_device_dataMethod · 0.85
get_device_dataMethod · 0.85
get_device_dataMethod · 0.85

Calls 2

to_stringMethod · 0.80
get_async_db_connFunction · 0.70

Tested by

no test coverage detected