(
dev_eui: EUI64,
)
| 9 | use lrwn::EUI64; |
| 10 | |
| 11 | pub 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 | } |
no test coverage detected