clickhouse-rust-type-mismatches

clickhouse-rust-type-mismatches is a skill for Claude Code, Codex from divinevideo/divine-mobile. It costs 280 tokens per session (2,142 once invoked), scanned A, original, MPL-2.0.

A guide to fixing data-conversion errors between ClickHouse and Rust programs using the clickhouse-rs library.

In plain words
What is it for?
Use it to diagnose UTF-8, enum, missing-column, and numeric-type errors, especially in queries with joins, aggregates, views, or shared result structs.
Why use it?
It helps when the database returns values or columns in a different shape or type than the Rust struct expects.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions Claude Code; installed under .agents/ (shared by several agents).

Good fit Use it to diagnose UTF-8, enum, missing-column, and numeric-type errors, especially in queries with joins, aggregates, views, or shared result structs.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/divinevideo/divine-mobile/clickhouse-rust-type-mismatches
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add divinevideo/divine-mobile --skill clickhouse-rust-type-mismatches
Clone the repo
git clone --depth 1 https://github.com/divinevideo/divine-mobile

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for clickhouse-rust-type-mismatches

README.md
[![agentmods](https://agentmods.dev/badge/skills/divinevideo/divine-mobile/clickhouse-rust-type-mismatches/github.svg)](https://agentmods.dev/skills/divinevideo/divine-mobile/clickhouse-rust-type-mismatches)
Your own site
<a href="https://agentmods.dev/skills/divinevideo/divine-mobile/clickhouse-rust-type-mismatches"><img src="https://agentmods.dev/badge/skills/divinevideo/divine-mobile/clickhouse-rust-type-mismatches/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for clickhouse-rust-type-mismatches

Your own site · 80×15
<a href="https://agentmods.dev/skills/divinevideo/divine-mobile/clickhouse-rust-type-mismatches"><img src="https://agentmods.dev/badge/skills/divinevideo/divine-mobile/clickhouse-rust-type-mismatches.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 280 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,142 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Data Exfiltration · line 181
    Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
    Fix: Verify the destination URL is trusted and necessary. Remove or replace with documented APIs. Ensure no secrets, tokens, or PII are transmitted.
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00280 $0.02142
Opus 5 $0.00140 $0.01071
Sonnet 5 $0.00056 $0.00428
Haiku 4.5 $0.00028 $0.00214

Measured 11d ago against content hash 636415a76143, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

clickhouse-rust-type-mismatches scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -u 'user:pass' 'https://clickhouse-host:8443' \
.agents/skills/clickhouse-rust-type-mismatches/SKILL.md · 227 lines

How it starts

The opening of the file, as written. The whole thing — 227 lines — stays where its author put it; the contents beside it link to each section on GitHub.

ClickHouse-Rust Type Mismatches

Problem

When using the clickhouse-rs Rust crate with ClickHouse, deserialization errors occur due to type mismatches between the database schema and Rust struct definitions.

Context / Trigger Conditions

  • Error: "string is not valid utf8" when querying String columns
  • Error: "tag for enum is not valid" when deserializing rows
  • Error: "not enough data, probably a row type mismatches a database schema" when deserializing rows
  • Using #[derive(Row)] from clickhouse crate
  • Views that use LEFT JOIN or aggregate functions
  • Multiple query functions sharing the same Row struct but with different SELECT lists

Root Causes

0. Column Count Mismatch ("not enough data")

When multiple query functions share the same #[derive(Row)] struct, adding new fields to the struct and some queries but forgetting to update OTHER queries that use the same struct causes "not enough data" deserialization errors. The query returns fewer columns than the struct expects.

Symptoms:

  • Error: "not enough data, probably a row type mismatches a database schema"
  • One query function works, another fails, both using the same Row struct
  • Error is misleading — suggests DB schema issue but is actually a code bug

Debugging:

  1. Count the fields in the Rust Row struct
  2. Count the SELECT columns in the failing query
  3. Compare with the working query — look for missing columns
  4. Often caused by adding fields (like subtitle/text-track columns) to the struct and one query but forgetting to update a secondary query (e.g., get_by_id updated but get_by_d_tag forgotten)

Fix: Add the missing SELECT columns to the failing query to match the struct:

// Both queries must select the SAME columns in the SAME order as the struct
// If struct has 17 fields, every query using it must SELECT 17 columns

1a. FixedString vs String (SELECT / Deserialization)

ClickHouse FixedString(N) pads with null bytes. These don't deserialize cleanly as UTF-8 strings in Rust.

Read the full file on GitHub · 227 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 227 lines · 280 tokens per session scan A 636415a76143

Subscribe to this mod's changes

clickhouse-rust-type-mismatches is a skill published in the GitHub repository divinevideo/divine-mobile (265 stars, last pushed today), licensed MPL-2.0. It adds 280 tokens to every session and 2,142 once invoked, about $0.0014 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

rust-check

Run cargo check on the current Rust project to find compile errors.

Hmbown/CodeWhale · 15 tokens

stack-trace-rust-probe

Internal helper for meta-stack-trace-investigator. Use when a Rust panic or backtrace needs Rust-specific Result/Option checks, cargo test guidance, and patch targets.

opensquilla/opensquilla · 42 tokens

hotpath_init

Configure hotpath profiling in a Rust project. Adds the hotpath dependency with feature-gated setup, instruments main with hotpath::main, functions with measure/measureall, and wraps channels, mutexes, rwlocks, streams, futures, reqwest clients, axum routers and byte-level I/O with hotpath macros. Use when the user…

pawurb/hotpath-rs · 88 tokens

memory-safety-patterns

Implement memory-safe programming with RAII, ownership, smart pointers, and resource management across Rust, C++, and C. Use when writing safe systems code, managing resources, or preventing memory bugs.

rmyndharis/antigravity-skills · 45 tokens

windows-compat

Audit and harden this Rust repo (code-graph-mcp) for Windows correctness: path-spelling drift between producers, the 32,767-char command-line cap, index-key mismatches, and path predicates that assume one ecosystem's layout. Use whenever touching code that builds, compares, prints, or stores a filesystem path; that…

sdsrss/code-graph-mcp · 165 tokens

check-production-ready

Production readiness audit - checks unwrap elimination, error handling, clippy, docs, channel usage, and test count.

nwiizo/ccswarm · 27 tokens