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

Function partial_update

chirpstack/src/storage/device.rs:611–620  ·  view source on GitHub ↗
(dev_eui: EUI64, d: &DeviceChangeset)

Source from the content-addressed store, hash-verified

609}
610
611pub async fn partial_update(dev_eui: EUI64, d: &DeviceChangeset) -> Result<Device, Error> {
612 let d = diesel::update(device::dsl::device.find(&dev_eui))
613 .set(d)
614 .get_result::<Device>(&mut get_async_db_conn().await?)
615 .await
616 .map_err(|e| Error::from_diesel(e, dev_eui.to_string()))?;
617
618 info!(dev_eui = %dev_eui, "Device partially updated");
619 Ok(d)
620}
621
622pub async fn delete(dev_eui: &EUI64) -> Result<(), Error> {
623 let ra = diesel::delete(device::dsl::device.find(&dev_eui))

Calls 4

setMethod · 0.80
to_stringMethod · 0.80
updateFunction · 0.70
get_async_db_connFunction · 0.70

Tested by 15

test_update_uplink_listFunction · 0.40
test_update_filter_listFunction · 0.40
test_lorawan_10Function · 0.40
run_testFunction · 0.40
run_testFunction · 0.40
test_downlink_schedulerFunction · 0.40
run_scheduler_testFunction · 0.40
test_uplinkFunction · 0.40