mirror of
https://github.com/BurntSushi/jiff.git
synced 2025-12-23 08:47:45 +00:00
This is like #240, but adds a crate with wrapper types that implements Diesel traits. Unlike with SQLx, and unless I'm missing something, Diesel actually exposes enough of an API to implement datetime support for MySQL. So that's included here. Diesel does seem to use some internal privileged APIs for its own `chrono` and `time` integration that avoids unnecessary allocations when parsing datetimes from SQLite values. Again, unless I'm missing something, Jiff is forced to allocate into a `String` first. (But Jiff only really needs a `&[u8]`.) I found this experience, along with SQLx, to be absolutely mind-numbing. Just writing out the example code (which I also used for ad hoc testing) took an incredible amount of time. I spent _way_ more time playing fucking type tetris with both SQLx and Diesel than I did anything else _combined_. It's utterly ridiculous. This further solidifies my opinion that when you publish crates with an obscene amount of inter-connected traits, the resulting API becomes very difficult to use. I'm happy to iterate on the implementation and APIs of this crate (and `jiff-sqlx`) after an initial release. But I very much appreciate reviews from Diesel and SQLx experts. I'm going to say that this closes #50 since this I think this, along with `jiff-sqlx` and `jiff-icu`, gives us a solid foundation to build upon. We can track more specific integrations in new issues. Closes #50 |
||
|---|---|---|
| .. | ||
| Cargo.toml | ||
| main.rs | ||