Skip to content

fix: namedValue namedDatevalue usage error #1575

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

Conversation

tosolveit
Copy link
Contributor

Summary

Fixes #1555 query parameter binding for queries using named date values such as clickhouse.DateNamed(...).

Previously, if the query contained Named parameters (e.g., {table:Identifier}) and also used DateNamed, the driver returned ErrExpectedStringValueInNamedValueForQueryParameter.

This update extends bindQueryOrAppendParameters to support driver.NamedDateValue types and formats them using formatTimeWithScale, ensuring proper formatting and compatibility with the query parameter protocol.

Checklist

  • Unit and integration tests covering the common scenarios were added
  • A human-readable description of the changes was provided to include in CHANGELOG

Copy link
Member

@SpencerTorres SpencerTorres 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 the fix! We will likely deprecate the type of parameters used in the original issue in favor of ClickHouse's syntax, but this is still helpful for existing users. https://clickhouse.com/docs/sql-reference/syntax#defining-and-using-query-parameters

@SpencerTorres SpencerTorres merged commit 0351728 into ClickHouse:main Jun 12, 2025
12 checks passed
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.

Cannot use NamedValue and NamedDateValue together
2 participants