chtypes 0.1.0

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.0"
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 analogue 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 `spec/c-abi.md`
# 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/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"