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

Function create

chirpstack/src/storage/application.rs:300–312  ·  view source on GitHub ↗
(a: Application)

Source from the content-addressed store, hash-verified

298}
299
300pub async fn create(a: Application) -> Result<Application, Error> {
301 a.validate()?;
302
303 let a: Application = diesel::insert_into(application::table)
304 .values(&a)
305 .get_result(&mut get_async_db_conn().await?)
306 .await
307 .map_err(|e| Error::from_diesel(e, a.id.to_string()))?;
308
309 info!(id = %a.id, "Application created");
310
311 Ok(a)
312}
313
314pub async fn get(id: &Uuid) -> Result<Application, Error> {
315 let a = application::dsl::application

Callers 1

create_applicationFunction · 0.70

Calls 3

to_stringMethod · 0.80
get_async_db_connFunction · 0.70
validateMethod · 0.45

Tested by

no test coverage detected