Commit graph

5 commits

Author SHA1 Message Date
Andrew Gallant
0541c1979c cargo: restore sanity to iterative development
I'm not sure when or how exactly it happened, but in the last weeks,
I've noticed that `rustc` gets effectively stun-locked whenever I make a
change to a source file in Jiff. A quick examination of what the fuck my
computer is doing seems to reveal that it's spending oodles of time
compiling diesel over and over.

I have no idea why this is happening and I don't really care to spend
the time unraveling the mysteries of diesel.

So I took a hammer to the problem. I have effectively shunted all
examples and all "integration" crates out of Jiff's core workspace and
into their own little bloated fiefdoms. To compensate for the fact that
`cargo test --all` no longer tests these things, I've added shell
scripts to run the requisite tests. And those shell scripts are now run
in CI.

I'm now back to a state where I can save a file in Jiff and I get
sub-second `cargo check` response times.
2025-04-10 20:54:30 -04:00
Gary Coady
1756ba03a4
jiff-diesel: update tests to use Insertable and Selectable derivations
This moves the majority of tests to use the `Insertable` and `Selectable`
derivations from the query struct. This follows idiomatic Diesel usage, and
also tests actual database round-tripping via database stores.

The downside of this is that tables need to exist; I have created temporary
tables in this PR for this purpose (which are dropped when the session
is closed).

PR #254
2025-02-17 07:51:21 -05:00
Gary Coady
8b61b32602
jiff-diesel: add Nullable wrappers for Diesel types
PR #248
2025-02-10 17:00:00 -05:00
Gary Coady
65d48d1450
examples/diesel-*: update examples to use QueryableByName and sql_query
PR #247
2025-02-10 16:20:42 -05:00
Andrew Gallant
13d553b944 jiff-diesel: add integration crate for Diesel
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
2025-02-08 15:16:20 -05:00