clicktype-transport 0.2.0

Transport layer for ClickType - HTTP client for ClickHouse
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use async_trait::async_trait;
use crate::error::Result;

/// Trait defining the transport layer capabilities required for batch ingestion.
///
/// This allows swapping the real HTTP client for a mock client during testing.
#[async_trait]
pub trait ClickTypeTransport: Send + Sync + Clone + 'static {
    /// Insert raw RowBinary data.
    async fn insert_binary(&self, table_name: &str, data: &[u8]) -> Result<()>;

    /// Validate that the table schema matches the expected columns.
    ///
    /// `expected_columns` is a list of (name, type) tuples.
    async fn validate_schema(&self, table_name: &str, expected_columns: &[(&str, String)]) -> Result<()>;
}