Add optional time crate support for apalis-sql #649
Replies: 8 comments 8 replies
-
|
There was a time we tried to support both |
Beta Was this translation helpful? Give feedback.
-
|
Here is the PR in question: |
Beta Was this translation helpful? Give feedback.
-
|
My reason for wanting it is the same reason addressed in the original PR:
|
Beta Was this translation helpful? Give feedback.
-
|
@Himmelschmidt Understandable. This would need to be done in phases as there are 3 crates using sqlx. I would want to avoid having either deps (chrono/time) in |
Beta Was this translation helpful? Give feedback.
-
|
This was possibly the mistake: #[cfg(feature = "chrono")]
type Timestamp = chrono::DateTime<chrono::Utc>;
#[cfg(feature = "time")]
type Timestamp = time::OffsetDateTime;We may want to use a trait but this may need a little more thinking. This crate might be a reference to what we need to do. |
Beta Was this translation helpful? Give feedback.
-
|
@Himmelschmidt Please look at apalis-dev/apalis-postgres#35 and give some feedback |
Beta Was this translation helpful? Give feedback.
-
|
I just opened PRs #654 , apalis-dev/apalis-mysql#14 , apalis-dev/apalis-postgres#38 , apalis-dev/apalis-sqlite#29 I did local paths for the crates while I was working on it. I guess I can make the edits once the apalis-sql is merged? Let me know if this was completely not in the direction you had hoped. |
Beta Was this translation helpful? Give feedback.
-
|
I think you should be able to write migrations to the type you want. There
is no specific reason AFAIK
…On Fri, 26 Dec 2025, 18:18 Himmelschmidt, ***@***.***> wrote:
@geofmureithi <https://github.com/geofmureithi> is there a specific
reason apalis-mysql has datetime columns instead of timestamp? Not very
familiar with MySql and I'm having issues with my initial approach. That
is: all chrono/time conditional compilation happens in apalis-sql. The
downstream crates each just need to import the type and ext
—
Reply to this email directly, view it on GitHub
<#649 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AWXVRGVQ2WMRHFJAJVGZO4L4DVGVZAVCNFSM6AAAAACPQQPEZSVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTKMZUG42TCNA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I want to use sqlx with the time crate but apalis-sql hardcodes chrono. I added time crate support as an optional feature in my fork - chrono stays as the default so it's fully backwards compatible.
This would require changes in at least apalis-postgres (that's what I use). Are there other parts of the project that would need updating too?
Would you be open to a PR for this?
Beta Was this translation helpful? Give feedback.
All reactions