Commit graph

10 commits

Author SHA1 Message Date
jesse
64940a824b
doc: typo fixing
Some checks are pending
ci / test-core (nightly, ubuntu-latest, nightly) (push) Waiting to run
ci / test-various-feature-combos (macos, macos-latest, nightly) (push) Waiting to run
ci / test-various-feature-combos (nightly, ubuntu-latest, nightly) (push) Waiting to run
ci / test-release (push) Waiting to run
ci / test-doc (push) Waiting to run
ci / test-bench (push) Waiting to run
ci / test-miri (push) Waiting to run
ci / win-msvc (push) Waiting to run
ci / win-gnu (push) Waiting to run
ci / msrv (push) Waiting to run
ci / examples (push) Waiting to run
ci / integrations (push) Waiting to run
ci / time-zone-init (macos-latest) (push) Waiting to run
ci / time-zone-init (ubuntu-24.04-arm) (push) Waiting to run
ci / time-zone-init (ubuntu-latest) (push) Waiting to run
ci / cross (aarch64-unknown-linux-gnu) (push) Waiting to run
ci / cross (i686-unknown-linux-gnu) (push) Waiting to run
ci / time-zone-init (windows-latest) (push) Waiting to run
ci / cross (aarch64-linux-android) (push) Waiting to run
ci / cross (powerpc-unknown-linux-gnu) (push) Waiting to run
ci / cross (powerpc64-unknown-linux-gnu) (push) Waiting to run
ci / cross (s390x-unknown-linux-gnu) (push) Waiting to run
ci / cross (x86_64-linux-android) (push) Waiting to run
ci / riscv32imc-unknown-none-elf (push) Waiting to run
ci / wasm32-wasip1 (push) Waiting to run
ci / wasm32-unknown-emscripten (push) Waiting to run
ci / wasm32-unknown-uknown (push) Waiting to run
ci / docsrs (push) Waiting to run
ci / rustfmt (push) Waiting to run
ci / generated (push) Waiting to run
Mostly found via `typos-cli` and `codespell`.

PR #443
2025-11-06 16:11:16 -05:00
Joey de Waal
ef7ed1f85e
jiff-sqlx: remove dependency on sqlx-core
Specifically, the `sqlx-core`, `sqlx-sqlite`
and `sqlx-postgres` crates aren't actually
supposed to be depended on directly.
2025-04-23 08:49:39 -04:00
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
Andrew Gallant
252a0806dc
jiff-sqlx-0.1.1 2025-03-06 16:28:08 -05:00
Andrew Gallant
9aa9afe532 doc: clarify error conditions in Timestamp constructors
... and also add a "Crate features" section to the crate docs of
`jiff-sqlx` and `jiff-diesel`.

Fixes #273, Fixes #277
2025-02-27 17:17:44 -05:00
Andrew Gallant
d0d1b2ec27
crates: temporarily disconnect jiff-{icu,sqlx,diesel} from workspace
... I can't figure out how to publish `jiff 0.2` with these crates
trying to select `jiff 0.2` from crates.io... which doesn't exist yet.

WTF. I guess I'm probably holding Cargo workspaces wrong. ¯\_(ツ)_/¯
2025-02-10 21:37:54 -05:00
Andrew Gallant
65bac81c84 crates: beef up Cargo.toml and READMEs for new crates 2025-02-10 21:24:55 -05:00
Andrew Gallant
ef211be259
jiff-sqlx: fix link to examples 2025-02-08 15:22:15 -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
Andrew Gallant
0dff6c6443 jiff-sqlx: add integration crate for SQLx
This PR adds a new `jiff-sqlx` crate. It defines wrapper types for
`Timestamp`, `DateTime`, `Date`, `Time` and `Span`. For each wrapper
type, the SQLx encoding traits are implemented. (Except, with `Span`,
only the decoding trait is implemented.)

This is similar to #141, but organizes things a bit differently. This
also comes with SQLite support. MySQL support is missing since it seems,
at present, to require exposing APIs in SQLx for a correct
implementation.

This initial implementation also omits `Zoned` entirely. I've left a
comment in the source code explaining why. The quick summary is that, at
least for PostgreSQL, I don't see a way to provide support for it
without either silently losing data (the time zone) or just storing it
as an RFC 9557 timestamp in a `TEXT` field. The downside of the latter
is that it doesn't use PostgreSQL native datetime types. (Becuase we
can't. Because PostgreSQL doesn't support storing anything other than
civil time and timestamps with respect to its datetime types.) I do
personally lean toward just using RFC 9557 as a `TEXT` type, but I'd
like to collect real use cases first to make sure that's the right way
to go.

Ref #50, Closes #141
Ref https://github.com/launchbadge/sqlx/issues/3487
2025-02-07 07:24:09 -05:00