Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

time features by default #42

Open
1g0rkR opened this issue Aug 15, 2024 · 11 comments
Open

time features by default #42

1g0rkR opened this issue Aug 15, 2024 · 11 comments

Comments

@1g0rkR
Copy link

1g0rkR commented Aug 15, 2024

Hi there,

Would be possible to have a choice between time and chrono of sqlx?

I would appreciate for such opportunities.

@1g0rkR
Copy link
Author

1g0rkR commented Aug 15, 2024

It conflicts with originally sqlx/chrono in my code.

@maxcountryman
Copy link
Owner

If you would like to make a PR that enables either choice, I'm happy to review.

@vinnymeller
Copy link

vinnymeller commented Aug 15, 2024

@1g0rkR I dont love how I implemented it but my fork here is working with chrono: https://github.com/vinnymeller/tower-sessions-sqlx-store

as stated in the readme I do not recommend at all using it - but you can at a minimum you can see which part(s) of the code need to be updated to support chrono

edit: if nobody has gotten to it i will look to make the changes neater & make a pr in a few weeks when I'm back from vacation

@karuna
Copy link
Contributor

karuna commented Sep 2, 2024

maybe something like this? #46
for me it's becoming critical because of sqlx < 0.8.1 security problem

@karuna
Copy link
Contributor

karuna commented Sep 2, 2024

mostly from @vinnymeller

@maxcountryman
Copy link
Owner

for me it's becoming critical because of sqlx < 0.8.1 security problem

This is why SessionStore is a public trait. You can and should implement stores to suit your specific use cases and needs.

@dns2utf8-novaziun
Copy link

Is there a way to disable time somehow? Because it causes a circular break with sqlx right now

@dns2utf8-novaziun
Copy link

I found the PR #46 that was reverted in this commit 3a546a9
I don't understand why, because it just re-broke any setup with sqlx > 0.8.x

@nicolasauler
Copy link

nicolasauler commented Oct 1, 2024

Yeah, is there a recommended solution?
I'm also stuck because I need to update sqlx, but this crate then causes time feature dependency to be activated in sqlx

edit: actually, I reminded that I didn't actually care about chrono and migrated my app from chrono to time, no biggie

@dns2utf8-novaziun
Copy link

dns2utf8-novaziun commented Oct 3, 2024

I migrated my ${Something}Row structs to the time crate and made two functions that convert back and forth between chrono and time.
This is not great but was the pragmatic path out of the stuck situation while not having to rewrite all of my business logic

@maxcountryman
Copy link
Owner

Probably the feature selection can be removed entirely and replaced with something like this: https://github.com/maxcountryman/underway/blob/40f8f899587cb0125e2b8897a4349d2f9c0a391d/src/timestamp.rs which then is used in the crate here as a type override (note that this is particularly ugly in the linked example, but in practice could be cleaned up). Doing so allows e.g. https://github.com/maxcountryman/underway/blob/40f8f899587cb0125e2b8897a4349d2f9c0a391d/Cargo.toml#L15-L19.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants