sea-query icon indicating copy to clipboard operation
sea-query copied to clipboard

Support jiff types

Open tisonkun opened this issue 1 year ago • 3 comments

Ref to #714.

Ref to https://github.com/burntsushi/jiff/.

I use jiff and now convert all timestamps to string for construct query. We may add first-class support for jiff types.

In short, IMO jiff is better chrono.

tisonkun avatar Dec 31 '24 09:12 tisonkun

Here is my current wrapper solution:

impl From<Timestamp> for sea_query::Value {
    fn from(value: Timestamp) -> Self {
        sea_query::Value::from(format!("{:.6}", value.0))
    }
}

tisonkun avatar Mar 02 '25 00:03 tisonkun

Hey @tisonkun, thanks for the suggestions!!

We have jiff-sqlx, in which we can use jiff in sqlx. And I think we have support jiff in SeaQuery and SeaORM as well.

SQLx FAQ: Can SQLx Add Support for New Data-Type Crates (e.g. Jiff in addition to chrono and time)?

Ping @tyt2y3 for comments :P

billy1624 avatar Mar 04 '25 13:03 billy1624

Related Issues https://github.com/BurntSushi/jiff/issues/286

billy1624 avatar Mar 04 '25 14:03 billy1624