pub struct TypeDBClient { /* private fields */ }Expand description
Wrapper around the TypeDB Rust driver providing a clean async API for query execution and schema retrieval.
Implementations§
Source§impl TypeDBClient
impl TypeDBClient
Sourcepub async fn connect(config: &TypeDBSection) -> Result<Self, PipelineError>
pub async fn connect(config: &TypeDBSection) -> Result<Self, PipelineError>
Connect to a TypeDB server using the provided configuration.
Sourcepub async fn execute(
&self,
database: &str,
typeql: &str,
tx_type: &str,
) -> Result<Value, PipelineError>
pub async fn execute( &self, database: &str, typeql: &str, tx_type: &str, ) -> Result<Value, PipelineError>
Execute a TypeQL query and return results as JSON.
For read transactions, the transaction is used directly. For write and schema transactions, the transaction is committed after execution.
Sourcepub fn is_connected(&self) -> bool
pub fn is_connected(&self) -> bool
Check if the driver connection is open.
Trait Implementations§
Source§impl QueryExecutor for TypeDBClient
impl QueryExecutor for TypeDBClient
Source§fn execute<'a>(
&'a self,
database: &'a str,
typeql: &'a str,
transaction_type: &'a str,
) -> Pin<Box<dyn Future<Output = Result<Value, PipelineError>> + Send + 'a>>
fn execute<'a>( &'a self, database: &'a str, typeql: &'a str, transaction_type: &'a str, ) -> Pin<Box<dyn Future<Output = Result<Value, PipelineError>> + Send + 'a>>
Execute a TypeQL string against the given database.
Source§fn is_connected(&self) -> bool
fn is_connected(&self) -> bool
Check if the backend connection is alive.
Auto Trait Implementations§
impl Freeze for TypeDBClient
impl !RefUnwindSafe for TypeDBClient
impl Send for TypeDBClient
impl Sync for TypeDBClient
impl Unpin for TypeDBClient
impl UnsafeUnpin for TypeDBClient
impl !UnwindSafe for TypeDBClient
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> 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>
Converts
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>
Converts
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 moreSource§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