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

remove chrono #1317

Merged
merged 2 commits into from
Apr 21, 2022
Merged

remove chrono #1317

merged 2 commits into from
Apr 21, 2022

Conversation

PSeitz
Copy link
Contributor

@PSeitz PSeitz commented Apr 20, 2022

remove chrono

#1296

@@ -2702,7 +2701,6 @@ dependencies = [
"anyhow",
"async-trait",
"byte-unit",
"chrono",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there still a deps on chrono somewhere?
(I was expecting a larger diff in Cargo.lock)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, on diesel. They use it for serialization and don't plan to replace it diesel-rs/diesel#2928

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems optional though. Do we need that feature?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I answered that here #1317 (comment)

Copy link
Contributor

@fulmicoton fulmicoton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for asking the diesel people. They mentioned it was optional. Do we actually use this feature?

@PSeitz
Copy link
Contributor Author

PSeitz commented Apr 21, 2022

Thanks for asking the diesel people. They mentioned it was optional. Do we actually use this feature?

We use it in the postgremodel https://github.com/quickwit-oss/quickwit/blob/main/quickwit-metastore/src/postgresql/model.rs#L64

I think we could replace it and use i64 directly

NativeDateTime seems to be converted to timestamp which is i64

https://github.com/diesel-rs/diesel/blob/50c2c85032857a65e4a8d68dc851fa7ab91d65b2/diesel/src/pg/types/date_and_time/chrono.rs#L45

https://github.com/diesel-rs/diesel/blob/50c2c85032857a65e4a8d68dc851fa7ab91d65b2/diesel/src/pg/types/date_and_time/mod.rs#L22

@PSeitz PSeitz merged commit ee62e79 into quickwit-oss:main Apr 21, 2022
@PSeitz
Copy link
Contributor Author

PSeitz commented Apr 28, 2022

I did a test, and simply replacing the field with i64 will not work without an additional migration step.

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

Successfully merging this pull request may close these issues.

None yet

3 participants