Move creation of scoped db connection based on workspace to a middleware
Open
- Dominant language
- Rust
- Stars
- 2
- Forks
- 0
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 10
Description
Example
```
pub async fn create(
state: web::Data,
_auth: AuthenticatedRequest,
ws: Workspace,
body: web::Json,
) -> Result {
let trigger = TriggerType::from_str_val(&body.trigger)
.ok_or_else(|| AppError::InvalidRequest(format!("Invalid trigger: {}", body.trigger)))?;
let mut conn = kronos_common::db::scoped::scoped_connection(&state.pool, &ws.0.schema_name)
.await
.map_err(AppError::from)?;
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.