juspay / juspay/invokr

Move creation of scoped db connection based on workspace to a middleware

Open
#27 0 comments 0 reactions 0 assignees View on GitHub
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.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.