Derive `QueryArgs` for structs to provide named query arguments
- Dominant language
- Rust
- Stars
- 231
- Forks
- 30
- PR merge metrics
- No merged PRs in 30d
Description
Hello!
Would it be possible to execute queries like this :
```
#[derive(Queryable)]
struct MusicOutput {
pub id: Uuid,
pub name: String
}
let parameters = HashMap::from([
("artist", "John 5"),
]);
let music_output: Result = conn.query_required_single(
"select (
insert Artist {
name := $artist
} unless conflict on .name else (select Artist)
) {id, name}", ¶meters).await;
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by locating the `Queryable` derive and the `query_required_single` entry point, then trace how query parameters are currently accepted. The issue's example shows the intended result: a struct should derive `QueryArgs` and provide named arguments for the query; verify this by compiling an equivalent example.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100