https://github.com/lucacappelletti94/diesel-testing
Testing traits involving diesel
https://github.com/lucacappelletti94/diesel-testing
Last synced: 6 months ago
JSON representation
Testing traits involving diesel
- Host: GitHub
- URL: https://github.com/lucacappelletti94/diesel-testing
- Owner: LucaCappelletti94
- License: mit
- Created: 2025-02-12T19:34:54.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-06T09:18:30.000Z (12 months ago)
- Last Synced: 2025-08-18T09:55:29.606Z (6 months ago)
- Language: Rust
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# diesel-testing
Testing traits involving diesel
## The issue
Diesel provides many derive macros which, in the case of concrete structs, greatly simplify the implementation of traits such as `Insertable` - these derive generate many things, including for instance the types for the n-uples of the rows being inserted or extracted.
While this is great for concrete structs, when trying to define a trait `InsertableStruct` for a generic struct that is insertable such as:
```rust
pub trait InsertableStruct: Insertable {}
```
you will find that it actually is not enough for your struct to be actually insertable, but many other additional constraints have to be added.
Unfortunately, at this time, I could not figure out the whole set of constraints.