-
Notifications
You must be signed in to change notification settings - Fork 5
97 lines (93 loc) · 2.18 KB
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
---
source: tests/integration.rs
expression: code
snapshot_kind: text
---
// GENERATED CODE (ch2rs v0.1.8)
#![cfg_attr(rustfmt, rustfmt::skip)]
#![allow(warnings)]
#![allow(clippy::all)]
// Generated with the following options:
/*
ch2rs ch2rs_test -D \
--derive Clone \
--derive PartialEq \
-T 'FixedString(5)=[u8; 5]' \
-T 'Date=u16' \
-T 'DateTime=u32' \
-T 'DateTime64(9)=u64' \
-T 'Decimal(18, 9)=u64' \
-O 'blob=Vec<u8>' \
-B 'blob' \
-I 'ignored'
*/
#[derive(Debug, clickhouse::Row)]
#[derive(serde::Deserialize)]
#[derive(Clone)]
#[derive(PartialEq)]
pub struct Row<'a> {
/// this is a byte
pub u8: u8,
/// these are two bytes
pub u16: u16,
/// and these are four
pub u32: u32,
/// eight...
pub u64: u64,
/// come on!
pub u128: u128,
pub i8: i8,
pub i16: i16,
pub i32: i32,
pub i64: i64,
pub i128: i128,
pub bool: bool,
pub str: &'a str,
pub low_str: &'a str,
#[serde(with = "serde_bytes")]
pub blob: Vec<u8>,
pub fs: [u8; 5],
pub f32: f32,
pub f64: f64,
pub d: u16,
pub dt: u32,
pub dt64: u64,
#[serde(with = "::clickhouse::serde::ipv4")]
pub ipv4: ::std::net::Ipv4Addr,
#[serde(with = "::clickhouse::serde::ipv4::option")]
pub ipv4_opt: Option<::std::net::Ipv4Addr>,
pub ipv6: ::std::net::Ipv6Addr,
#[serde(with = "::clickhouse::serde::uuid")]
pub uuid: ::uuid::Uuid,
#[serde(with = "::clickhouse::serde::uuid::option")]
pub uuid_opt: Option<::uuid::Uuid>,
pub dec64: u64,
pub enum8: Enum8,
pub enum16: Enum16,
pub array: Vec<&'a str>,
pub tuple: (&'a str, &'a str, ),
pub str_opt: Option<&'a str>,
pub map_str: Vec<(&'a str, &'a str, )>,
pub map_f32: Vec<(&'a str, f32, )>,
pub default: u16,
pub material: u16,
pub alias: u16,
}
#[derive(Debug)]
#[derive(serde_repr::Deserialize_repr)]
#[derive(Clone)]
#[derive(PartialEq)]
#[repr(i8)]
pub enum Enum8 {
Empty = -128,
FooBar = 0,
}
#[derive(Debug)]
#[derive(serde_repr::Deserialize_repr)]
#[derive(Clone)]
#[derive(PartialEq)]
#[repr(i16)]
pub enum Enum16 {
Empty = -128,
FooBar = 1024,
}