pub struct XdbcTypeInfoDataBuilder {
infos: Vec<XdbcTypeInfo>,
}
Expand description
A builder for XdbcTypeInfoData
which is used to create CommandGetXdbcTypeInfo
responses.
§Example
use arrow_flight::sql::{Nullable, Searchable, XdbcDataType};
use arrow_flight::sql::metadata::{XdbcTypeInfo, XdbcTypeInfoDataBuilder};
// Create the list of metadata describing the server. Since this would not change at
// runtime, using once_cell::Lazy or similar patterns to constuct the list is a common approach.
let mut builder = XdbcTypeInfoDataBuilder::new();
builder.append(XdbcTypeInfo {
type_name: "INTEGER".into(),
data_type: XdbcDataType::XdbcInteger,
column_size: Some(32),
literal_prefix: None,
literal_suffix: None,
create_params: None,
nullable: Nullable::NullabilityNullable,
case_sensitive: false,
searchable: Searchable::Full,
unsigned_attribute: Some(false),
fixed_prec_scale: false,
auto_increment: Some(false),
local_type_name: Some("INTEGER".into()),
minimum_scale: None,
maximum_scale: None,
sql_data_type: XdbcDataType::XdbcInteger,
datetime_subcode: None,
num_prec_radix: Some(2),
interval_precision: None,
});
let info_list = builder.build().unwrap();
// to access the underlying record batch
let batch = info_list.record_batch(None);
Fields§
§infos: Vec<XdbcTypeInfo>
Implementations§
Source§impl XdbcTypeInfoDataBuilder
impl XdbcTypeInfoDataBuilder
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new instance of XdbcTypeInfoDataBuilder
.
Sourcepub fn append(&mut self, info: XdbcTypeInfo)
pub fn append(&mut self, info: XdbcTypeInfo)
Append a new row
Sourcepub fn build(self) -> Result<XdbcTypeInfoData>
pub fn build(self) -> Result<XdbcTypeInfoData>
Create helper structure for handling xdbc metadata requests.
Sourcepub fn schema(&self) -> SchemaRef
pub fn schema(&self) -> SchemaRef
Return the [Schema
] for a GetSchema RPC call with CommandGetXdbcTypeInfo
Trait Implementations§
Auto Trait Implementations§
impl Freeze for XdbcTypeInfoDataBuilder
impl RefUnwindSafe for XdbcTypeInfoDataBuilder
impl Send for XdbcTypeInfoDataBuilder
impl Sync for XdbcTypeInfoDataBuilder
impl Unpin for XdbcTypeInfoDataBuilder
impl UnwindSafe for XdbcTypeInfoDataBuilder
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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