requireSession

fun requireSession(session: Session? = null): Session

Returns the session, or if null/no-arg, the currently provided SessionLocal.

Throws

if session is null and no SessionLocal is available (e.g. not inside a SessionScope).