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

Function delete

chirpstack/src/storage/user.rs:193–204  ·  view source on GitHub ↗
(id: &Uuid)

Source from the content-addressed store, hash-verified

191}
192
193pub async fn delete(id: &Uuid) -> Result<(), Error> {
194 let ra = diesel::delete(user::dsl::user.find(&fields::Uuid::from(id)))
195 .execute(&mut get_async_db_conn().await?)
196 .await
197 .map_err(|e| Error::from_diesel(e, id.to_string()))?;
198
199 if ra == 0 {
200 return Err(Error::NotFound(id.to_string()));
201 }
202 info!(user_id = %id, "User deleted");
203 Ok(())
204}
205
206pub async fn get_count() -> Result<i64, Error> {
207 let count = user::dsl::user

Callers 15

delete_itemFunction · 0.70
flush_for_dev_euiFunction · 0.70
delete_deploymentFunction · 0.70
remove_devicesFunction · 0.70
remove_gatewaysFunction · 0.70
test_userFunction · 0.70
remove_deviceFunction · 0.70
test_update_uplink_listFunction · 0.50
test_update_filter_listFunction · 0.50

Calls 2

to_stringMethod · 0.80
get_async_db_connFunction · 0.70

Tested by 5

test_userFunction · 0.56
test_update_uplink_listFunction · 0.40
test_update_filter_listFunction · 0.40