opensrv_clickhouse/protocols/
protocol_type.rs

1// Copyright 2021 Datafuse Labs.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15// Name, version, revision, default DB
16pub const CLIENT_HELLO: u64 = 0;
17// Query id, query settings, stage up to which the query must be executed,
18// whether the compression must be used,
19// query text (without data for INSERTs).
20// A block of data (compressed or not).
21pub const CLIENT_QUERY: u64 = 1;
22// A block of data (compressed or not).
23pub const CLIENT_DATA: u64 = 2;
24// Cancel the query execution.
25pub const CLIENT_CANCEL: u64 = 3;
26// Check that connection to the server is alive.
27pub const CLIENT_PING: u64 = 4;
28// Check status of tables on the server
29pub const CLIENT_TABLES_STATUS_REQUEST: u64 = 5;
30// Keep the connection alive
31pub const CLIENT_KEEP_ALIVE: u64 = 6;
32// A block of data (compressed or not)
33pub const CLIENT_SCALAR: u64 = 7;
34// List of unique parts ids to exclude from query processing
35pub const CLIENT_INGORED_PART_UUIDS: u64 = 8;
36
37pub const SERVER_HELLO: u64 = 0;
38pub const SERVER_DATA: u64 = 1;
39pub const SERVER_EXCEPTION: u64 = 2;
40pub const SERVER_PROGRESS: u64 = 3;
41pub const SERVER_PONG: u64 = 4;
42pub const SERVER_END_OF_STREAM: u64 = 5;
43pub const SERVER_PROFILE_INFO: u64 = 6;
44pub const SERVER_TOTALS: u64 = 7;
45pub const SERVER_EXTREMES: u64 = 8;
46
47pub const NO_QUERY: u8 = 0;
48pub const INITIAL_QUERY: u8 = 1;
49pub const SECONDARY_QUERY: u8 = 2;