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

Function create

chirpstack/src/storage/user.rs:64–74  ·  view source on GitHub ↗
(u: User)

Source from the content-addressed store, hash-verified

62}
63
64pub async fn create(u: User) -> Result<User, Error> {
65 u.validate()?;
66
67 let u: User = diesel::insert_into(user::table)
68 .values(&u)
69 .get_result(&mut get_async_db_conn().await?)
70 .await
71 .map_err(|e| Error::from_diesel(e, u.id.to_string()))?;
72 info!(id = %u.id, "User created");
73 Ok(u)
74}
75
76pub async fn get(id: &Uuid) -> Result<User, Error> {
77 let u = user::dsl::user

Callers 15

test_fuotaFunction · 0.70
test_fuota_devicesFunction · 0.70
test_fuota_gatewaysFunction · 0.70
test_jobsFunction · 0.70
create_userFunction · 0.70
test_global_searchFunction · 0.70
test_relayFunction · 0.70
test_mqttFunction · 0.50
test_update_uplink_listFunction · 0.50

Calls 3

to_stringMethod · 0.80
get_async_db_connFunction · 0.70
validateMethod · 0.45

Tested by 15

test_fuotaFunction · 0.56
test_fuota_devicesFunction · 0.56
test_fuota_gatewaysFunction · 0.56
test_jobsFunction · 0.56
test_global_searchFunction · 0.56
test_relayFunction · 0.56
test_mqttFunction · 0.40
test_update_uplink_listFunction · 0.40
test_update_filter_listFunction · 0.40