Struct arrow_flight::sql::metadata::SqlInfoList
source · pub struct SqlInfoList { /* private fields */ }Expand description
A builder for CommandGetSqlInfo response.
CommandGetSqlInfo are metadata requests used by a Flight SQL
server to communicate supported capabilities to Flight SQL
clients.
Servers construct a SqlInfoList by adding infos via
with_sql_info and build the response using encode.
The available configuration options are defined in the Flight SQL protos.
Example
// Create the list of metadata describing the server
let info_list = SqlInfoList::new()
.with_sql_info(SqlInfo::FlightSqlServerName, "server name")
// ... add other SqlInfo here ..
.with_sql_info(
SqlInfo::FlightSqlServerTransaction,
SqlSupportedTransaction::Transaction as i32,
);
// Create the batch to send back to the client
let batch = info_list.encode().unwrap();Implementations§
source§impl SqlInfoList
impl SqlInfoList
pub fn new() -> Self
sourcepub fn with_sql_info(
self,
name: impl SqlInfoName,
value: impl Into<SqlInfoValue>
) -> Self
pub fn with_sql_info( self, name: impl SqlInfoName, value: impl Into<SqlInfoValue> ) -> Self
register the specific sql metadata item
sourcepub fn filter(&self, info: &[u32]) -> Cow<'_, Self>
pub fn filter(&self, info: &[u32]) -> Cow<'_, Self>
Filter this info list keeping only the info values specified
in infos.
Returns self if infos is empty (no filtering)
sourcepub fn encode(&self) -> Result<RecordBatch>
pub fn encode(&self) -> Result<RecordBatch>
Encode the contents of this list according to the FlightSQL spec
sourcepub fn schema() -> &'static Schema
pub fn schema() -> &'static Schema
Return the Schema for a GetSchema RPC call with crate::sql::CommandGetSqlInfo
Trait Implementations§
source§impl Clone for SqlInfoList
impl Clone for SqlInfoList
source§fn clone(&self) -> SqlInfoList
fn clone(&self) -> SqlInfoList
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for SqlInfoList
impl Debug for SqlInfoList
source§impl Default for SqlInfoList
impl Default for SqlInfoList
source§impl PartialEq<SqlInfoList> for SqlInfoList
impl PartialEq<SqlInfoList> for SqlInfoList
source§fn eq(&self, other: &SqlInfoList) -> bool
fn eq(&self, other: &SqlInfoList) -> bool
This method tests for
self and other values to be equal, and is used
by ==.impl StructuralPartialEq for SqlInfoList
Auto Trait Implementations§
impl RefUnwindSafe for SqlInfoList
impl Send for SqlInfoList
impl Sync for SqlInfoList
impl Unpin for SqlInfoList
impl UnwindSafe for SqlInfoList
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
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request