pub struct PreparedStatement<T> {
flight_sql_client: FlightSqlServiceClient<T>,
parameter_binding: Option<RecordBatch>,
handle: Bytes,
dataset_schema: Schema,
parameter_schema: Schema,
}
Expand description
A PreparedStatement
Fields§
§flight_sql_client: FlightSqlServiceClient<T>
§parameter_binding: Option<RecordBatch>
§handle: Bytes
§dataset_schema: Schema
§parameter_schema: Schema
Implementations§
Source§impl PreparedStatement<Channel>
impl PreparedStatement<Channel>
pub(crate) fn new( flight_client: FlightSqlServiceClient<Channel>, handle: impl Into<Bytes>, dataset_schema: Schema, parameter_schema: Schema, ) -> Self
Sourcepub async fn execute(&mut self) -> Result<FlightInfo, ArrowError>
pub async fn execute(&mut self) -> Result<FlightInfo, ArrowError>
Executes the prepared statement query on the server.
Sourcepub async fn execute_update(&mut self) -> Result<i64, ArrowError>
pub async fn execute_update(&mut self) -> Result<i64, ArrowError>
Executes the prepared statement update query on the server.
Sourcepub fn parameter_schema(&self) -> Result<&Schema, ArrowError>
pub fn parameter_schema(&self) -> Result<&Schema, ArrowError>
Retrieve the parameter schema from the query.
Sourcepub fn dataset_schema(&self) -> Result<&Schema, ArrowError>
pub fn dataset_schema(&self) -> Result<&Schema, ArrowError>
Retrieve the ResultSet schema from the query.
Sourcepub fn set_parameters(
&mut self,
parameter_binding: RecordBatch,
) -> Result<(), ArrowError>
pub fn set_parameters( &mut self, parameter_binding: RecordBatch, ) -> Result<(), ArrowError>
Set a RecordBatch that contains the parameters that will be bind.
Sourceasync fn write_bind_params(&mut self) -> Result<(), ArrowError>
async fn write_bind_params(&mut self) -> Result<(), ArrowError>
Submit parameters to the server, if any have been set on this prepared statement instance Updates our stored prepared statement handle with the handle given by the server response.
Sourcefn unpack_prepared_statement_handle(
&self,
put_result: &PutResult,
) -> Result<Option<Bytes>, ArrowError>
fn unpack_prepared_statement_handle( &self, put_result: &PutResult, ) -> Result<Option<Bytes>, ArrowError>
Decodes the app_metadata stored in a PutResult
as a
DoPutPreparedStatementResult
and then returns
the inner prepared statement handle as [Bytes
]
Trait Implementations§
Source§impl<T: Clone> Clone for PreparedStatement<T>
impl<T: Clone> Clone for PreparedStatement<T>
Source§fn clone(&self) -> PreparedStatement<T>
fn clone(&self) -> PreparedStatement<T>
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 moreAuto Trait Implementations§
impl<T> !Freeze for PreparedStatement<T>
impl<T> !RefUnwindSafe for PreparedStatement<T>
impl<T> Send for PreparedStatement<T>where
T: Send,
impl<T> Sync for PreparedStatement<T>where
T: Sync,
impl<T> Unpin for PreparedStatement<T>where
T: Unpin,
impl<T> !UnwindSafe for PreparedStatement<T>
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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