MCPcopy Create free account
hub / github.com/apache/arrow-rs / begin_transaction

Method begin_transaction

arrow-flight/src/sql/client.rs:410–422  ·  view source on GitHub ↗

Request to begin a transaction.

(&mut self)

Source from the content-addressed store, hash-verified

408
409 /// Request to begin a transaction.
410 pub async fn begin_transaction(&mut self) -> Result<Bytes> {
411 let cmd = ActionBeginTransactionRequest {};
412 let action = Action {
413 r#type: BEGIN_TRANSACTION.to_string(),
414 body: cmd.as_any().encode_to_vec().into(),
415 };
416 let req = self.set_request_headers(action.into_request())?;
417 let mut result = self.flight_client.do_action(req).await?.into_inner();
418 let result = result.message().await?.unwrap();
419 let any = Any::decode(&*result.body)?;
420 let begin_result: ActionBeginTransactionResult = any.unpack()?.unwrap();
421 Ok(begin_result.transaction_id)
422 }
423
424 /// Request to commit/rollback a transaction.
425 pub async fn end_transaction(

Callers 1

Calls 6

set_request_headersMethod · 0.80
unpackMethod · 0.80
decodeFunction · 0.50
as_anyMethod · 0.45
into_innerMethod · 0.45
do_actionMethod · 0.45

Tested by 1