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

Function partial_update

chirpstack/src/storage/gateway.rs:268–277  ·  view source on GitHub ↗
(gateway_id: EUI64, gw: &GatewayChangeset)

Source from the content-addressed store, hash-verified

266}
267
268pub async fn partial_update(gateway_id: EUI64, gw: &GatewayChangeset) -> Result<Gateway, Error> {
269 let gw = diesel::update(gateway::dsl::gateway.find(&gateway_id))
270 .set(gw)
271 .get_result::<Gateway>(&mut get_async_db_conn().await?)
272 .await
273 .map_err(|e| Error::from_diesel(e, gateway_id.to_string()))?;
274
275 info!(gateway_id = %gateway_id, "Gateway partially updated");
276 Ok(gw)
277}
278
279pub async fn delete(gateway_id: &EUI64) -> Result<(), Error> {
280 let ra = diesel::delete(gateway::dsl::gateway.find(&gateway_id))

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected