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
#![recursion_limit = "128"]
#![allow(clippy::unknown_clippy_lints)]
extern crate byteorder;
extern crate chrono;
extern crate chrono_tz;
#[cfg(not(feature = "cityhash_rs"))]
extern crate clickhouse_driver_cth;
#[cfg(feature = "cityhash_rs")]
extern crate clickhouse_driver_cthrs;
extern crate core;
#[macro_use]
extern crate futures;
extern crate hostname;
#[macro_use]
extern crate lazy_static;
#[cfg(lz4)]
extern crate clickhouse_driver_lz4a;
extern crate log;
extern crate parking_lot;
#[cfg(test)]
extern crate rand;
extern crate thiserror;
extern crate tokio;
extern crate url;
extern crate uuid;
use pool::options::Options;
#[cfg(not(target_endian = "little"))]
compile_error!("only little-endian platforms supported");
mod client;
mod compression;
mod errors;
mod pool;
pub mod prelude;
#[macro_use]
mod protocol;
mod sync;
mod types;
#[allow(dead_code)]
const MAX_STRING_LEN: usize = 64 * 1024;
const MAX_BLOCK_SIZE: usize = 640 * 1024;
const MAX_BLOCK_SIZE_BYTES: usize = 10 * 1024 * 1024;
pub static CLIENT_NAME: &str = "Rust Native Driver";
pub const CLICK_HOUSE_REVISION: u64 = 54405;
pub const CLICK_HOUSE_DBMSVERSION_MAJOR: u64 = 1;
pub const CLICK_HOUSE_DBMSVERSION_MINOR: u64 = 1;
lazy_static! {
static ref HOSTNAME: String = {
hostname::get().map_or_else(
|_orig| String::new(),
|s| s.into_string().unwrap_or_default(),
)
};
static ref DEF_OPTIONS: Options = crate::pool::options::Options::default();
}
pub fn description() -> String {
format!(
"{} {}.{}.{}",
CLIENT_NAME,
CLICK_HOUSE_DBMSVERSION_MAJOR,
CLICK_HOUSE_DBMSVERSION_MINOR,
CLICK_HOUSE_REVISION
)
}
#[test]
fn test_encoder() {
assert_eq!(description(), "Rust Native Driver 1.1.54405");
}