fix(clickhouse): handle date parameters in WHERE clauses and format output dates - #310
Conversation
|
This PR was not deployed automatically as @ifeelBALANCED does not have access to the Railway project. In order to get automatic PR deploys, please add @ifeelBALANCED to your workspace on Railway. |
There was a problem hiding this comment.
Pull request overview
This PR fixes DateTime64 conversion errors in ClickHouse queries by automatically wrapping ISO date strings with parseDateTime64BestEffort() and configuring ClickHouse to output dates in ISO 8601 format.
Changes:
- Added automatic detection and wrapping of ISO date strings in query parameters with
parseDateTime64BestEffort() - Implemented SQL string escaping function to prevent injection vulnerabilities
- Configured ClickHouse client to output dates in ISO format
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| apps/desktop/src/entities/connection/dialects/clickhouse/index.ts | Adds escapeSqlString() helper and date detection logic to wrap ISO date strings with parseDateTime64BestEffort() |
| apps/desktop/electron/main/connections/clickhouse.ts | Configures ClickHouse client with date_time_output_format: 'iso' setting |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Can you add a screen recording of if this problem has been solved or not @ifeelBALANCED
2026-01-26.18.06.11.mov |
…/clickhouse-date-issue
Description of Changes
parseDateTime64BestEffort()wrapper for ISO date strings in query parameters to fix DateTime64 conversion errorsdate_time_output_format: 'iso'to return dates in ISO 8601 formatFixes DateTime64 conversion errors when comparing dates in WHERE clauses.
Closes #309