Skip to content

feat: flag for time/chrono crate support#16

Merged
abonander merged 2 commits intoClickHouse:masterfrom
JoTurk:add-temporal
Feb 5, 2026
Merged

feat: flag for time/chrono crate support#16
abonander merged 2 commits intoClickHouse:masterfrom
JoTurk:add-temporal

Conversation

@JoTurk
Copy link
Copy Markdown
Contributor

@JoTurk JoTurk commented Oct 12, 2025

Introduces a new --temporal option to choose temporal type mapping:

  • raw (default): primitive types for backward compatibility
  • time: uses time crate (time::Date, time::OffsetDateTime, time::Duration)
  • chrono: uses chrono crate (chrono::NaiveDate, chrono::DateTime, etc.)
  • Adds support for ClickHouse Time and Time64(precision) types.

Updated all snapshots.

We use this tool at my work, but difficult to work with for date & time types,
without using syn and quote. This patch solves it for us.

resolves #13

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Oct 12, 2025

CLA assistant check
All committers have signed the CLA.

@JoTurk JoTurk force-pushed the add-temporal branch 3 times, most recently from b72498e to 06454b3 Compare October 12, 2025 22:43
@JoTurk
Copy link
Copy Markdown
Contributor Author

JoTurk commented Oct 22, 2025

@slvrtrn sorry for the ping, can you please check this when you have time :)

@slvrtrn
Copy link
Copy Markdown
Contributor

slvrtrn commented Oct 22, 2025

@abonander PTAL

@slvrtrn slvrtrn requested a review from abonander October 22, 2025 10:24
@JoTurk
Copy link
Copy Markdown
Contributor Author

JoTurk commented Nov 26, 2025

@abonander I'm sorry for the ping, Just checking in to see if you've had a chance to review this. We've been using it for about a month.

@abonander abonander closed this Feb 2, 2026
@abonander abonander reopened this Feb 2, 2026
@abonander
Copy link
Copy Markdown

Just wanted to trigger a CI re-run.

@JoTurk JoTurk force-pushed the add-temporal branch 2 times, most recently from 4a908e8 to 325c198 Compare February 2, 2026 23:20
@JoTurk
Copy link
Copy Markdown
Contributor Author

JoTurk commented Feb 2, 2026

@abonander thank you for approving.
i force pushed to update my email :) I think the CI is failing because the integration test doesn't set a password or the password is incorrect. I can make a another PR to update the CI. but it's not related to this PR.

@abonander
Copy link
Copy Markdown

I've pinged our security team internally, I think the credentials just need to be rotated.

Comment thread src/options.rs Outdated
Comment thread src/codegen.rs Outdated
Comment thread CHANGELOG.md
Introduces a new --temporal option to choose temporal type mapping:
- raw (default): primitive types for backward compatibility
- time: uses time crate (time::Date, time::OffsetDateTime, time::Duration)
- chrono: uses chrono crate (chrono::NaiveDate, chrono::DateTime, etc.)
- Adds support for ClickHouse Time and Time64(precision) types.

Updated all snapshots.
@JoTurk
Copy link
Copy Markdown
Contributor Author

JoTurk commented Feb 3, 2026

@loyd thank you for the review, I fixed the comments.

@abonander
Copy link
Copy Markdown

I didn't realize we don't actually run this CI against ClickHouse Cloud.

Try adding env: CLICKHOUSE_SKIP_USER_SETUP: 1 to the service definition here:

services:
clickhouse:
image: clickhouse/clickhouse-server
ports:
- 8123:8123

@JoTurk
Copy link
Copy Markdown
Contributor Author

JoTurk commented Feb 4, 2026

@abonander done :)

@abonander abonander merged commit 8c5a0a4 into ClickHouse:master Feb 5, 2026
4 checks passed
@JoTurk JoTurk deleted the add-temporal branch February 5, 2026 20:50
@JoTurk
Copy link
Copy Markdown
Contributor Author

JoTurk commented Feb 5, 2026

@abonander thank you for merging, is it possible to tag this soon? thank you.

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.

Generate time/chrono

5 participants