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

Function delete

chirpstack/src/storage/gateway.rs:279–291  ·  view source on GitHub ↗
(gateway_id: &EUI64)

Source from the content-addressed store, hash-verified

277}
278
279pub async fn delete(gateway_id: &EUI64) -> Result<(), Error> {
280 let ra = diesel::delete(gateway::dsl::gateway.find(&gateway_id))
281 .execute(&mut get_async_db_conn().await?)
282 .await?;
283 if ra == 0 {
284 return Err(Error::NotFound(gateway_id.to_string()));
285 }
286 info!(
287 gateway_id = %gateway_id,
288 "Gateway deleted"
289 );
290 Ok(())
291}
292
293pub async fn get_count(filters: &Filters) -> Result<i64, Error> {
294 let mut q = gateway::dsl::gateway

Callers 2

delete_relay_gatewayFunction · 0.70
test_gatewayFunction · 0.70

Calls 2

to_stringMethod · 0.80
get_async_db_connFunction · 0.70

Tested by 1

test_gatewayFunction · 0.56