pub struct PooledClient { /* private fields */ }Expand description
A client acquired from the pool
Implementations§
Source§impl PooledClient
impl PooledClient
Methods from Deref<Target = Client>§
Sourcepub async fn execute(&self, sql: &str) -> Result<()>
pub async fn execute(&self, sql: &str) -> Result<()>
Execute a DDL statement (CREATE TABLE, DROP TABLE, etc.)
Sourcepub async fn query<T>(&self, sql: &str) -> Result<Vec<T>>where
T: DeserializeOwned + Row,
pub async fn query<T>(&self, sql: &str) -> Result<Vec<T>>where
T: DeserializeOwned + Row,
Execute a query and return typed results
The type T must implement serde::Deserialize and clickhouse::Row
Sourcepub async fn query_check(&self, sql: &str) -> Result<u64>
pub async fn query_check(&self, sql: &str) -> Result<u64>
Execute a query and count rows (for verification)
Sourcepub async fn insert<T>(&self, table_name: &str, rows: &[T]) -> Result<()>
pub async fn insert<T>(&self, table_name: &str, rows: &[T]) -> Result<()>
Insert rows using ClickHouse HTTP insert
The type T must implement serde::Serialize and clickhouse::Row
Sourcepub async fn insert_binary(&self, table_name: &str, data: &[u8]) -> Result<()>
pub async fn insert_binary(&self, table_name: &str, data: &[u8]) -> Result<()>
Insert raw RowBinary data directly to ClickHouse
This is the low-level method for high-performance batching. The data must be pre-serialized in RowBinary format.
Sourcepub async fn validate_schema<T>(&self, table_name: &str) -> Result<()>where
T: ClickTable,
pub async fn validate_schema<T>(&self, table_name: &str) -> Result<()>where
T: ClickTable,
Validate that the table schema matches the struct definition
This is critical for RowBinary inserts to prevent silent data corruption. Call this before starting batch inserts to ensure schema compatibility.
Trait Implementations§
Source§impl Deref for PooledClient
impl Deref for PooledClient
Source§impl DerefMut for PooledClient
impl DerefMut for PooledClient
Auto Trait Implementations§
impl Freeze for PooledClient
impl !RefUnwindSafe for PooledClient
impl Send for PooledClient
impl Sync for PooledClient
impl Unpin for PooledClient
impl !UnwindSafe for PooledClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more