Skip to main content

query

Attribute Macro query 

Source
#[query]
Expand description

Attribute macro for defining SQL functions in handlers.

§Example

#[sqlmodel::query]
async fn get_heroes(cx: &Cx, conn: &impl Connection) -> Vec<Hero> {
    sqlmodel::select!(Hero).all(cx, conn).await
}