Skip to main content

db

Function db 

Source
pub fn db(cx: &Cx) -> Result<Db>
Expand description

Returns the pooled [Db] registered on the router.

Never runs statements on another handle while a transaction holds its connection; drains or drops streaming list bodies before the next query.

§Errors

A declaration failure when called while a panel write’s transaction is open for the same request, such as from Resource::before_commit or a record fn: run the statement through the ex the hook received instead.