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

[SeaQuery] Support time crate on SQLite #409

Closed
billy1624 opened this issue Aug 8, 2022 · 4 comments · Fixed by #412
Closed

[SeaQuery] Support time crate on SQLite #409

billy1624 opened this issue Aug 8, 2022 · 4 comments · Fixed by #412
Assignees
Labels
good first issue Good for newcomers
Milestone

Comments

@billy1624
Copy link
Member

Native support of time crate has been added in PR launchbadge/sqlx#1865 and released as part of SQLx 0.6.1.

Now we could bind time on to SQLite query statement and get time from SQLite directly.

@billy1624 billy1624 added the good first issue Good for newcomers label Aug 8, 2022
@kyoto7250
Copy link
Contributor

I want to try it.

Do we need to rewrite around these codes?

#[cfg(feature = "with-time")]
Value::TimeDate(t) => {
args.add(Value::TimeDate(t).time_as_naive_utc_in_string());
}
#[cfg(feature = "with-time")]
Value::TimeTime(t) => {
args.add(Value::TimeTime(t).time_as_naive_utc_in_string());
}
#[cfg(feature = "with-time")]
Value::TimeDateTime(t) => {
args.add(Value::TimeDateTime(t).time_as_naive_utc_in_string());
}
#[cfg(feature = "with-time")]
Value::TimeDateTimeWithTimeZone(t) => {
args.add(Value::TimeDateTimeWithTimeZone(t).time_as_naive_utc_in_string());

@ikrivosheev
Copy link
Member

@kyoto7250 yep and you need fix: https://github.com/SeaQL/sea-query/blob/master/sea-query-driver/src/sqlx_sqlite.rs

@ikrivosheev ikrivosheev added this to the 0.27.x milestone Aug 9, 2022
@kyoto7250
Copy link
Contributor

@ikrivosheev
Thank you, I will try it :)

@ikrivosheev
Copy link
Member

@ikrivosheev Thank you, I will try it :)

It doesn't look very hard) Good look, ping me if you need help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants