Skip to content

Conversation

@koxudaxi
Copy link
Collaborator

@koxudaxi koxudaxi commented Jan 6, 2026

The consolidated 00_init.sql contains multiple statements (CREATE DATABASE,
CREATE TABLE, ALTER TABLE). ClickHouse's HTTP interface doesn't support
multi-statement queries, so curl --data-binary fails silently after the
first statement.

Solution: Use docker exec with clickhouse-client --multiquery to properly
execute all statements in the init scripts.

@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 f1783b8 Jan 07 2026, 07:28 AM

Copy link
Collaborator Author

koxudaxi commented Jan 6, 2026

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@koxudaxi koxudaxi marked this pull request as ready for review January 6, 2026 15:47
@koxudaxi koxudaxi requested a review from willbakst as a code owner January 6, 2026 15:47
@koxudaxi koxudaxi force-pushed the 01-07-fix_ci_use_clickhouse-client_for_multi-statement_sql_init branch from 14eb26e to d4fea98 Compare January 7, 2026 04:05
@koxudaxi koxudaxi force-pushed the 01-06-feat_docker_add_clickhouse_service_for_local_development branch from 680a1a7 to 7c1dba9 Compare January 7, 2026 04:05
@koxudaxi koxudaxi force-pushed the 01-07-fix_ci_use_clickhouse-client_for_multi-statement_sql_init branch from d4fea98 to 78facee Compare January 7, 2026 05:16
@koxudaxi koxudaxi force-pushed the 01-06-feat_docker_add_clickhouse_service_for_local_development branch from 7c1dba9 to 396eb63 Compare January 7, 2026 05:16
@koxudaxi koxudaxi force-pushed the 01-07-fix_ci_use_clickhouse-client_for_multi-statement_sql_init branch 2 times, most recently from aeeee53 to 901c620 Compare January 7, 2026 05:28
@koxudaxi koxudaxi changed the base branch from 01-06-feat_docker_add_clickhouse_service_for_local_development to graphite-base/1819 January 7, 2026 05:56
@koxudaxi koxudaxi force-pushed the 01-07-fix_ci_use_clickhouse-client_for_multi-statement_sql_init branch from 901c620 to 2a43639 Compare January 7, 2026 06:03
@koxudaxi koxudaxi force-pushed the graphite-base/1819 branch from 396eb63 to 6dfcc0a Compare January 7, 2026 06:03
@koxudaxi koxudaxi changed the base branch from graphite-base/1819 to 01-06-feat_docker_add_clickhouse_service_for_local_development January 7, 2026 06:03
echo "Running $script..."
curl -s "http://${CLICKHOUSE_USER}:${CLICKHOUSE_PASSWORD}@localhost:8123/" --data-binary @"$script"
done
run: bun run clickhouse:migrate
Copy link

Choose a reason for hiding this comment

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

This line is causing the CI to fail because it's using 'bun run clickhouse:migrate' which is likely not properly set up. Either the script is not defined in package.json, or the migrator.ts file and migrations directory with SQL files don't exist in the expected location. Ensure that the clickhouse:migrate script is defined in package.json, the migrator.ts file is properly implemented, and the SQL migration files have been moved from docker/clickhouse/init/ to clickhouse/migrations/.

Spotted by Graphite Agent (based on CI logs)

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

echo "Running $script..."
curl -s "http://${CLICKHOUSE_USER}:${CLICKHOUSE_PASSWORD}@localhost:8123/" --data-binary @"$script"
done
run: bun run clickhouse:migrate
Copy link

Choose a reason for hiding this comment

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

This line is causing CI to fail because the new 'bun run clickhouse:migrate' command is trying to execute migration files that contain PostgreSQL-style syntax incompatible with ClickHouse. The migration files need to be updated to use proper ClickHouse syntax (replacing types like VARCHAR with String, etc.) before this command can work correctly.

Spotted by Graphite Agent (based on CI logs)

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

@koxudaxi koxudaxi force-pushed the 01-07-fix_ci_use_clickhouse-client_for_multi-statement_sql_init branch from 2a43639 to b353486 Compare January 7, 2026 06:45
@koxudaxi koxudaxi force-pushed the 01-06-feat_docker_add_clickhouse_service_for_local_development branch from 6dfcc0a to e2314ff Compare January 7, 2026 06:54
@koxudaxi koxudaxi force-pushed the 01-07-fix_ci_use_clickhouse-client_for_multi-statement_sql_init branch 2 times, most recently from 5b459f4 to 5a1fe76 Compare January 7, 2026 07:03
@koxudaxi koxudaxi force-pushed the 01-06-feat_docker_add_clickhouse_service_for_local_development branch from e2314ff to 9445846 Compare January 7, 2026 07:03
- Replace CI ClickHouse init with `bun run clickhouse:migrate`
- Remove docker/clickhouse/init/ directory (migrator handles schema)
- Remove init volume mount from compose.yml
- Update STRUCTURE.md to reflect migrator-based setup

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@koxudaxi koxudaxi force-pushed the 01-07-fix_ci_use_clickhouse-client_for_multi-statement_sql_init branch from 5a1fe76 to f1783b8 Compare January 7, 2026 07:06
@koxudaxi koxudaxi force-pushed the 01-06-feat_docker_add_clickhouse_service_for_local_development branch from 9445846 to f5af9b1 Compare January 7, 2026 07:06
@koxudaxi koxudaxi changed the base branch from 01-06-feat_docker_add_clickhouse_service_for_local_development to graphite-base/1819 January 7, 2026 07:10
@koxudaxi koxudaxi closed this Jan 7, 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