Struct libsql_client::http::Client
source · pub struct Client { /* private fields */ }
Expand description
Generic HTTP client. Needs a helper function that actually sends the request.
Implementations§
source§impl Client
impl Client
sourcepub fn new(
inner: InnerClient,
url: impl Into<String>,
token: impl Into<String>
) -> Self
pub fn new( inner: InnerClient, url: impl Into<String>, token: impl Into<String> ) -> Self
Creates a database client with JWT authentication.
§Arguments
url
- URL of the database endpointtoken
- auth token
sourcepub fn from_config(inner: InnerClient, config: Config) -> Result<Self>
pub fn from_config(inner: InnerClient, config: Config) -> Result<Self>
Establishes a database client from a Config
object
pub fn from_env(inner: InnerClient) -> Result<Client>
source§impl Client
impl Client
pub async fn raw_batch( &self, stmts: impl IntoIterator<Item = impl Into<Statement>> ) -> Result<BatchResult>
sourcepub async fn execute(
&self,
stmt: impl Into<Statement> + Send
) -> Result<ResultSet>
pub async fn execute( &self, stmt: impl Into<Statement> + Send ) -> Result<ResultSet>
§Arguments
stmt
- the SQL statement
pub async fn execute_in_transaction( &self, tx_id: u64, stmt: Statement ) -> Result<ResultSet>
pub async fn commit_transaction(&self, tx_id: u64) -> Result<()>
pub async fn rollback_transaction(&self, tx_id: u64) -> Result<()>
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
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