1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
//! # ClickHouse Native Client
//!
//! A native async Rust client for ClickHouse database, ported from the C++
//! [clickhouse-cpp](https://github.com/ClickHouse/clickhouse-cpp) library.
//!
//! This crate implements the ClickHouse native TCP binary protocol with
//! LZ4/ZSTD compression, TLS support, and all major ClickHouse data types.
//!
//! # Production Readiness
//!
//! Most of the codebase was created by converting the C++ clickhouse-cpp
//! client. Although the client is already used to ingest TiBs of data a day
//! and is relatively well covered by unit tests, there may be bugs. Test your
//! use case before committing.
//!
//! # Quick Start
//!
//! ```no_run
//! use clickhouse_native_client::{Client, ClientOptions, Block};
//! use clickhouse_native_client::column::numeric::ColumnUInt64;
//! use std::sync::Arc;
//!
//! # async fn example() -> Result<(), Box<dyn std::error::Error>> {
//! // Connect to ClickHouse
//! let opts = ClientOptions::new("localhost", 9000)
//! .database("default")
//! .user("default");
//! let mut client = Client::connect(opts).await?;
//!
//! // Execute DDL
//! client.execute("CREATE TABLE IF NOT EXISTS test (id UInt64) ENGINE = Memory").await?;
//!
//! // Insert data
//! let mut col = ColumnUInt64::new();
//! col.append(1);
//! col.append(2);
//! let mut block = Block::new();
//! block.append_column("id", Arc::new(col))?;
//! client.insert("test", block).await?;
//!
//! // Query data
//! let result = client.query("SELECT id FROM test").await?;
//! for block in result.blocks() {
//! println!("rows: {}", block.row_count());
//! }
//! # Ok(())
//! # }
//! ```
//!
//! # Feature Flags
//!
//! - **`tls`** - Enables TLS/SSL connections via `rustls` and `tokio-rustls`.
//!
//! # Modules
//!
//! - [`client`] - Async client API (`Client`, `ClientOptions`)
//! - [`block`] - Data blocks (`Block`, `BlockInfo`)
//! - [`mod@column`] - Column types for all ClickHouse data types
//! - [`query`] - Query builder and protocol messages
//! - [`types`] - ClickHouse type system and parser
//! - [`compression`] - LZ4/ZSTD compression
//! - [`protocol`] - Protocol constants (packet types, revisions)
//! - [`error`] - Error types and `Result` alias
//! - [`connection`] - Async TCP/TLS connection wrapper
//! - [`wire_format`] - Wire protocol encoding helpers
//! - [`io`] - Block reader/writer for async I/O
//! - `ssl` - TLS/SSL options (requires `tls` feature)
/// Data blocks (collections of named columns).
/// Async client API and connection options.
/// Column type implementations for all ClickHouse data types.
/// LZ4 and ZSTD block compression.
/// Async TCP/TLS connection wrapper.
/// Error types and `Result` alias.
/// Block reader/writer for async I/O.
/// Protocol constants (packet types, revision numbers).
/// Query builder and protocol messages.
/// Re-exports from the connection module.
/// ClickHouse type system and type string parser.
/// Wire protocol encoding helpers (varint, fixed-size types).
/// TLS/SSL connection options (requires the `tls` feature).
pub use ;
pub use ;
pub use ConnectionOptions;
pub use ;
pub use ;
pub use SSLOptions;