MCPcopy Create free account
hub / github.com/SeaQL/sea-orm / get_by_id

Function get_by_id

examples/rocket_okapi_example/api/src/okapi_example.rs:112–119  ·  view source on GitHub ↗
(conn: Connection<Db>, id: i32)

Source from the content-addressed store, hash-verified

110#[openapi(tag = "POST")]
111#[get("/<id>")]
112async fn get_by_id(conn: Connection<Db>, id: i32) -> R<Option<post::Model>> {
113 let db = conn.into_inner();
114
115 let post: Option<post::Model> = Query::find_post_by_id(&db, id)
116 .await
117 .expect("could not find post");
118 Ok(Json(post))
119}
120
121/// # delete post by Id
122#[openapi(tag = "POST")]

Callers

nothing calls this directly

Calls 1

into_innerMethod · 0.80

Tested by

no test coverage detected