pub struct Client { /* private fields */ }Expand description
Micromegas FlightSQL client
Implementations§
Source§impl Client
impl Client
Sourcepub fn new(channel: Channel) -> Self
pub fn new(channel: Channel) -> Self
Creates a new client from a grpc channel
§Arguments
channel- The gRPC channel to use for communication.
Sourcepub fn inner_mut(&mut self) -> &mut FlightSqlServiceClient<Channel>
pub fn inner_mut(&mut self) -> &mut FlightSqlServiceClient<Channel>
Returns a mutable reference to the inner FlightSqlServiceClient.
This allows direct access to the underlying FlightSQL client for advanced operations.
Sourcepub async fn query(
&mut self,
sql: String,
query_range: Option<TimeRange>,
) -> Result<Vec<RecordBatch>>
pub async fn query( &mut self, sql: String, query_range: Option<TimeRange>, ) -> Result<Vec<RecordBatch>>
Executes a SQL query and returns the results as a vector of RecordBatch.
§Arguments
sql- The SQL query string to execute.query_range- An optionalTimeRangeto filter the query results by time.
Sourcepub async fn query_stream(
&mut self,
sql: String,
query_range: Option<TimeRange>,
) -> Result<FlightRecordBatchStream>
pub async fn query_stream( &mut self, sql: String, query_range: Option<TimeRange>, ) -> Result<FlightRecordBatchStream>
Executes a SQL query and returns the results as a FlightRecordBatchStream.
This function is useful for processing large query results incrementally.
§Arguments
sql- The SQL query string to execute.query_range- An optionalTimeRangeto filter the query results by time.
Sourcepub async fn prepare_statement(
&mut self,
sql: String,
) -> Result<PreparedStatement>
pub async fn prepare_statement( &mut self, sql: String, ) -> Result<PreparedStatement>
Prepares a SQL statement and returns a PreparedStatement.
This function allows to compute the schema of a query without actually executing it.
§Arguments
sql- The SQL query string to prepare.
Sourcepub async fn prepare_query(
&mut self,
sql: String,
query_range: Option<TimeRange>,
) -> Result<QueryEstimate>
pub async fn prepare_query( &mut self, sql: String, query_range: Option<TimeRange>, ) -> Result<QueryEstimate>
Plans a query without running it: returns its schema and the server’s scan estimate.
The estimate fields come from FlightInfo.total_bytes (negative means unknown) and an
optional JSON app_metadata object with estimate_precision and within_scan_cap.
A server that reports none of them yields None for each.
§Arguments
sql- The SQL query string to plan.query_range- An optionalTimeRangethe query would run over.
Auto Trait Implementations§
impl !Freeze for Client
impl !RefUnwindSafe for Client
impl !UnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl UnsafeUnpin for Client
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].