chtypes 0.1.2

ClickHouse's own type system, schema validation, DEFAULT/TTL semantics and coercion, per ClickHouse version, over the frozen chs_* C ABI
Documentation
[package]
name = "chtypes"
version = "0.1.2"
edition = "2024"
rust-version = "1.85"
license = "Apache-2.0"
repository = "https://github.com/wave-rf/chtypes"
homepage = "https://github.com/wave-rf/chtypes"
documentation = "https://docs.rs/chtypes"
keywords = ["clickhouse", "types", "schema", "validation", "ffi"]
categories = ["database", "api-bindings"]
description = "ClickHouse's own type system, schema validation, DEFAULT/TTL semantics and coercion, per ClickHouse version, over the frozen chs_* C ABI"

[dependencies]
libloading = "0.8"
serde = { version = "1", features = ["derive"] }
# serde_json reads `manifest.json` and writes the settings object that crosses the
# C boundary — both of which are this crate's own well-formed UTF-8.
#
# It deliberately does NOT read result documents. `raw_value` was the analog of
# Go's json.RawMessage here, but serde_json cannot parse a document at all when a
# String column's bytes are not valid UTF-8 — which is how this crate came to
# retry through `String::from_utf8_lossy` and destroy the bytes the C ABI contract
# calls authoritative. `crate::doc` reads those documents over `&[u8]`, and
# `crate::json` compares leaf text exactly; `arbitrary_precision` is not enabled
# for the same reason it never was (see those modules' docs).
serde_json = "1"
thiserror = "2"

# --- the `fetch` feature: chtypes::ensure and the `chtypes` binary (docs/guides/fetch.md).
# Every crate below is optional and behind `fetch`, so `--no-default-features`
# builds with exactly the dependency set above.
#
# ed25519-dalek verifies SHA256SUMS.sig (spec §4); verification only, so the
# precomputed tables and zeroize are off. sha2 is the digest the whole chain
# hashes with, pinned to the series dalek itself uses so there is one copy.
ed25519-dalek = { version = "3", optional = true, default-features = false }
sha2 = { version = "0.11", optional = true, default-features = false }
# ureq fetches over HTTPS (rustls + webpki roots, no OpenSSL). Its gzip feature
# is OFF on purpose: a transparently un-gzipped body would hash differently
# from the bytes SHA256SUMS records. base64 (for the signature file) is pinned
# to the series ureq uses so there is one copy.
ureq = { version = "3", optional = true, default-features = false, features = ["rustls"] }
base64 = { version = "0.23", optional = true }
# tar + flate2 unpack the artifact tarball; xattr support is not wanted.
tar = { version = "0.4", optional = true, default-features = false }
flate2 = { version = "1", optional = true }

[features]
default = ["fetch"]
# `chtypes::ensure`, the registry's autofetch option and the `chtypes` binary.
fetch = [
  "dep:ed25519-dalek",
  "dep:sha2",
  "dep:ureq",
  "dep:base64",
  "dep:tar",
  "dep:flate2",
]

[[bin]]
name = "chtypes"
path = "src/main.rs"
required-features = ["fetch"]

# The fetch suite runs the binary and the fixtures; it does not exist without
# the feature.
[[test]]
name = "fetch"
required-features = ["fetch"]

[dev-dependencies]
# The integration tests read manifest.json themselves, to prove the loader took
# the library file name from it rather than constructing one.
serde_json = "1"

[[example]]
name = "demo"
path = "examples/demo.rs"

# CI already runs `cargo clippy --all-targets -- -D warnings`, which enforces
# clippy's default lint set (the `correctness`/`suspicious`/`style`/
# `complexity`/`perf` groups); this table only ADDS to that, and every entry
# below is already clean on this tree.
#
# `clippy::pedantic` (317 hits) and `clippy::nursery` are not enabled: at
# that volume it stops being "stricter" and starts being a source-wide
# rewrite outside a lint-tooling change's scope. `clippy::cargo` is enabled
# except `multiple_crate_versions`, which fires once (two `syn` majors pulled
# in transitively by different dependencies) and can only be cleared by a
# dependency bump, not a lint config. `unwrap_used`/`expect_used`/`panic`/
# `print_stdout` were tried and dropped for the same reason (68-290 existing,
# legitimate hits in tests and the CLI binary); `dbg_macro`/`todo`/
# `unimplemented` were already zero-hit and are free debug-leftover guards.
[lints.clippy]
cargo = { level = "warn", priority = -1 }
multiple_crate_versions = "allow"
dbg_macro = "warn"
todo = "warn"
unimplemented = "warn"