Title: Record ClickHouse SQL (clickhouse-driver and clickhouse-connect) · Issue #392 · getappmap/appmap-python · GitHub
Open Graph Title: Record ClickHouse SQL (clickhouse-driver and clickhouse-connect) · Issue #392 · getappmap/appmap-python
X Title: Record ClickHouse SQL (clickhouse-driver and clickhouse-connect) · Issue #392 · getappmap/appmap-python
Description: What changes for users: a team whose Python service talks to ClickHouse gets the SQL it runs in its AppMap recordings, the same way SQLAlchemy and Django users do today. Why: feedback from a CTO evaluating AppMap this week. The most usef...
Open Graph Description: What changes for users: a team whose Python service talks to ClickHouse gets the SQL it runs in its AppMap recordings, the same way SQLAlchemy and Django users do today. Why: feedback from a CTO ev...
X Description: What changes for users: a team whose Python service talks to ClickHouse gets the SQL it runs in its AppMap recordings, the same way SQLAlchemy and Django users do today. Why: feedback from a CTO ev...
Opengraph URL: https://github.com/getappmap/appmap-python/issues/392
X: @github
Domain: github.com
IPv4 address: 140.82.113.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Record ClickHouse SQL (clickhouse-driver and clickhouse-connect)","articleBody":"**What changes for users:** a team whose Python service talks to ClickHouse gets the SQL it runs in its AppMap recordings, the same way SQLAlchemy and Django users do today.\n\n**Why:** feedback from a CTO evaluating AppMap this week. The most useful thing AppMap could show him was the SQL his code runs, and his service uses a ClickHouse driver directly, not SQLAlchemy, so recordings showed no SQL at all. Teams running AI coding agents want this view most: what queries did the change add or move.\n\n**Today**\n\n```\nSQLAlchemy ── before/after_cursor_execute ──► SqlEvent ✅ (appmap/sqlalchemy.py)\nDjango ── connection wrapper ───────────► SqlEvent ✅ (appmap/django.py)\nclickhouse-driver (native TCP) ──────────────► nothing ❌\nclickhouse-connect (HTTP) ──────────────► at most an http_client_request\n to :8123, no SQL event ❌\n```\n\n**Proposed**\n\nA hook module per driver, opt-in like `appmap.sqlalchemy`, that emits `SqlEvent` (vendor `clickhouse`, server version when known) plus a `ReturnEvent` with elapsed time:\n\n| Driver | Calls to wrap |\n| --- | --- |\n| `clickhouse-driver` | `clickhouse_driver.Client.execute`, `execute_iter`, `execute_with_progress`, `query_dataframe` |\n| `clickhouse-connect` | `Client.query`, `command`, `insert`, `raw_query` (and the `*_df` / `*_arrow` variants) |\n\nNotes:\n- `clickhouse-sqlalchemy` users are probably covered already through the SQLAlchemy hook. Worth a test to confirm.\n- With `clickhouse-connect` and `appmap.http` both on, the HTTP call to ClickHouse should nest under the SQL event, or be suppressed, so it is not reported as an outside HTTP dependency.\n- `executemany`-style inserts: follow the SQLAlchemy hook and record the statement once with a count.\n\n**Tests:** run against a real ClickHouse server (the `clickhouse/clickhouse-server` Docker image in CI), not a mock. A mocked driver would test that the wrapper is called, not that a recording shows the query.\n\n**Out of scope:** Go support, which was the other gap in the same feedback.\n\n🤖 Generated with [Claude Code](https://claude.com/claude-code)\n\n\n---\n_Generated by [Claude Code](https://claude.ai/code)_","author":{"url":"https://github.com/evlawler","@type":"Person","name":"evlawler"},"datePublished":"2026-11-18T17:07:48Z","url":"https://github.com/getappmap/appmap-python/issues/392"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:5dd6b97c-8706-4f3c-67a7-b788f79e6376 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9DF4:3280A:182996B:1FCD73A:6B031CA7 |
| html-safe-nonce | 2b478973599f40628a4274980f7198368a7fc5c84a13895f6695a15200391c9a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5REY0OjMyODBBOjE4Mjk5NkI6MUZDRDczQTo2QjAzMUNBNyIsInZpc2l0b3JfaWQiOiIxNDU4ODQ3MzM1NzcwNDMxMTEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 6b6c91556e57bec49f310756a4d7d263ee2acc59e901c06239986dc9f0420aaf |
| hovercard-subject-tag | issue:6472544379 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getappmap/appmap-python/392/issue_layout |
| twitter:image | https://opengraph.githubassets.com/77bd6b31510ad91c62c23055420a1976f21699df51ddfdfb9082596d55d42bd7/getappmap/appmap-python/issues/392 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/77bd6b31510ad91c62c23055420a1976f21699df51ddfdfb9082596d55d42bd7/getappmap/appmap-python/issues/392 |
| og:image:alt | What changes for users: a team whose Python service talks to ClickHouse gets the SQL it runs in its AppMap recordings, the same way SQLAlchemy and Django users do today. Why: feedback from a CTO ev... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | evlawler |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/getappmap/appmap-python git https://github.com/getappmap/appmap-python.git |
| octolytics-dimension-user_id | 46610017 |
| octolytics-dimension-user_login | getappmap |
| octolytics-dimension-repository_id | 314785884 |
| octolytics-dimension-repository_nwo | getappmap/appmap-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 314785884 |
| octolytics-dimension-repository_network_root_nwo | getappmap/appmap-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width