pub struct Client { /* private fields */ }Expand description
An async client for queries, table writes, and catalog operations.
Start with builder to configure your endpoint and API key.
Clones share the underlying HTTP connection pool.
Implementations§
Source§impl Client
impl Client
Sourcepub fn builder(endpoint: impl ToString) -> ClientBuilder
pub fn builder(endpoint: impl ToString) -> ClientBuilder
Returns a builder for endpoint.
Sourcepub fn new<E: IntoUrl>(endpoint: E, client: Client) -> Result<Self, Error>
pub fn new<E: IntoUrl>(endpoint: E, client: Client) -> Result<Self, Error>
Creates a client from an HTTP(S) endpoint URL and a
reqwest::Client.
Configure client as shown in ClientBuilder::http_client. The write
timeout defaults to 30 seconds; use builder to customize it or
attach an API key.
Sourcepub fn statement(&self, statement: impl Into<String>) -> Statement
pub fn statement(&self, statement: impl Into<String>) -> Statement
Creates a Statement builder for statement.
Sourcepub fn statement_handle(&self, statement_id: Uuid) -> StatementHandle
pub fn statement_handle(&self, statement_id: Uuid) -> StatementHandle
Returns a StatementHandle for an existing statement_id without making a request.
Sourcepub fn table(&self, table: impl Into<String>) -> Table
pub fn table(&self, table: impl Into<String>) -> Table
Selects table in the default scopedb.public namespace.
Sourcepub async fn query(
&self,
statement: impl Into<String>,
) -> Result<ResultSet, Error>
pub async fn query( &self, statement: impl Into<String>, ) -> Result<ResultSet, Error>
Submits statement and waits for its ResultSet.
If waiting fails after submission, pass Error::statement_id to
statement_handle to inspect or resume waiting on the running
execution rather than resubmitting the query.
Sourcepub async fn append_rows(
&self,
database: &str,
schema: &str,
table: &str,
ndjson: impl Into<String>,
) -> Result<AppendRowsResult, Error>
pub async fn append_rows( &self, database: &str, schema: &str, table: &str, ndjson: impl Into<String>, ) -> Result<AppendRowsResult, Error>
Appends newline-delimited JSON rows to database.schema.table in a single request.
See Table::append for payload limits and recovery semantics.