Skip to content

Conversation

@koxudaxi
Copy link
Collaborator

@koxudaxi koxudaxi commented Jan 6, 2026

TL;DR

Improved ClickHouse integration with better date formatting and search functionality.

What changed?

  • Extracted date formatting logic into a dedicated utility module (clickhouse/utils.ts) with tests
  • Changed span name search from hasToken to position to properly support underscores in search queries
  • Updated the web handler to use the Workers-compatible ClickHouse client for Cloudflare environments
  • Fixed timestamp formatting in outbox processor to use the proper ClickHouse DateTime64 format
  • Updated ESM module detection in the ClickHouse sync local script

How to test?

  1. Verify search functionality works correctly with underscores in span names
  2. Test the application in Cloudflare dev environment to ensure ClickHouse client works properly
  3. Run the test suite to verify date formatting functions work as expected
  4. Check that the outbox processor correctly formats timestamps for ClickHouse

Why make this change?

  • The previous search implementation using hasToken treated underscores as separators, breaking searches for span names containing underscores
  • Date formatting was inconsistent across the codebase, leading to potential compatibility issues with ClickHouse
  • The application needed proper Cloudflare Workers support for the ClickHouse client
  • Centralizing date formatting logic improves maintainability and ensures consistent behavior

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Jan 6, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
v2-docs bbb5d6a Jan 08 2026, 02:47 PM

@koxudaxi koxudaxi force-pushed the 01-06-feat_api_add_search_api_schema_definitions branch from 8bd2d15 to 58938a8 Compare January 6, 2026 14:21
@koxudaxi koxudaxi force-pushed the 01-06-test_clickhouse_add_local_clickhouse_verification_script branch from 8beeb60 to 19d712e Compare January 6, 2026 14:21
@koxudaxi koxudaxi force-pushed the 01-06-feat_api_add_search_api_schema_definitions branch from 58938a8 to c837ed8 Compare January 6, 2026 14:35
@koxudaxi koxudaxi force-pushed the 01-06-test_clickhouse_add_local_clickhouse_verification_script branch 2 times, most recently from 30675b3 to 371b355 Compare January 6, 2026 14:43
@koxudaxi koxudaxi force-pushed the 01-06-feat_api_add_search_api_schema_definitions branch from c837ed8 to 00c2766 Compare January 6, 2026 14:43
@koxudaxi koxudaxi force-pushed the 01-06-test_clickhouse_add_local_clickhouse_verification_script branch from 371b355 to bd3bb06 Compare January 6, 2026 14:49
@koxudaxi koxudaxi force-pushed the 01-06-feat_api_add_search_api_schema_definitions branch from 00c2766 to 0ccab8e Compare January 6, 2026 14:49
@koxudaxi koxudaxi force-pushed the 01-06-test_clickhouse_add_local_clickhouse_verification_script branch from bd3bb06 to ccc73d0 Compare January 6, 2026 14:55
@koxudaxi koxudaxi force-pushed the 01-06-feat_api_add_search_api_schema_definitions branch 2 times, most recently from b9ec121 to ec6fb78 Compare January 6, 2026 15:05
@koxudaxi koxudaxi force-pushed the 01-06-test_clickhouse_add_local_clickhouse_verification_script branch from ccc73d0 to 5d7273b Compare January 6, 2026 15:05
@koxudaxi koxudaxi force-pushed the 01-06-feat_api_add_search_api_schema_definitions branch from ec6fb78 to 33aa4e1 Compare January 6, 2026 15:13
@koxudaxi koxudaxi force-pushed the 01-06-test_clickhouse_add_local_clickhouse_verification_script branch 2 times, most recently from 2011761 to dbb502d Compare January 6, 2026 15:23
@koxudaxi koxudaxi force-pushed the 01-06-test_clickhouse_add_local_clickhouse_verification_script branch from cd03adc to 1c6fd0c Compare January 8, 2026 10:22
@koxudaxi koxudaxi force-pushed the 01-06-test_python_add_e2e_clickhouse_verification_script branch 2 times, most recently from 17766d0 to a1ff199 Compare January 8, 2026 10:25
@koxudaxi koxudaxi force-pushed the 01-06-test_clickhouse_add_local_clickhouse_verification_script branch 2 times, most recently from 17dc3da to 25c98a6 Compare January 8, 2026 10:30
@koxudaxi koxudaxi force-pushed the 01-06-test_python_add_e2e_clickhouse_verification_script branch from a1ff199 to 729a62d Compare January 8, 2026 10:30
@koxudaxi koxudaxi force-pushed the 01-06-test_clickhouse_add_local_clickhouse_verification_script branch 2 times, most recently from 8ed19df to c1a3ec7 Compare January 8, 2026 12:00
@koxudaxi koxudaxi force-pushed the 01-06-test_python_add_e2e_clickhouse_verification_script branch 2 times, most recently from 32e0583 to e9d7873 Compare January 8, 2026 12:10
@koxudaxi koxudaxi force-pushed the 01-06-test_clickhouse_add_local_clickhouse_verification_script branch 2 times, most recently from 92fdfd7 to b3a1f41 Compare January 8, 2026 12:21
@koxudaxi koxudaxi force-pushed the 01-06-test_python_add_e2e_clickhouse_verification_script branch 2 times, most recently from 8f24ac7 to e9b13c9 Compare January 8, 2026 13:08
@koxudaxi koxudaxi force-pushed the 01-06-test_clickhouse_add_local_clickhouse_verification_script branch 2 times, most recently from f9dfbfb to 193b184 Compare January 8, 2026 13:20
@koxudaxi koxudaxi force-pushed the 01-06-test_python_add_e2e_clickhouse_verification_script branch 2 times, most recently from 0072fb2 to 83c851a Compare January 8, 2026 13:25
@koxudaxi koxudaxi force-pushed the 01-06-test_clickhouse_add_local_clickhouse_verification_script branch 2 times, most recently from 6f0afe4 to b87ac33 Compare January 8, 2026 13:46
@koxudaxi koxudaxi force-pushed the 01-06-test_python_add_e2e_clickhouse_verification_script branch from 83c851a to 3d2d048 Compare January 8, 2026 13:46
@koxudaxi koxudaxi force-pushed the 01-06-test_clickhouse_add_local_clickhouse_verification_script branch from b87ac33 to 18f40b2 Compare January 8, 2026 14:05
@koxudaxi koxudaxi force-pushed the 01-06-test_python_add_e2e_clickhouse_verification_script branch from 3d2d048 to e480291 Compare January 8, 2026 14:05
@koxudaxi koxudaxi force-pushed the 01-06-test_clickhouse_add_local_clickhouse_verification_script branch from 18f40b2 to ad60f5d Compare January 8, 2026 14:33
@koxudaxi koxudaxi force-pushed the 01-06-test_python_add_e2e_clickhouse_verification_script branch from e480291 to 1300d75 Compare January 8, 2026 14:33
@koxudaxi koxudaxi force-pushed the 01-06-test_clickhouse_add_local_clickhouse_verification_script branch from ad60f5d to bbb5d6a Compare January 8, 2026 14:36
@koxudaxi koxudaxi force-pushed the 01-06-test_python_add_e2e_clickhouse_verification_script branch from 1300d75 to 439e129 Compare January 8, 2026 14:36
@koxudaxi koxudaxi closed this Jan 8, 2026
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.

3 participants