pub struct HttpEngine { /* private fields */ }Expand description
Authenticated client for the SQL API shared by local and Cloud UQA nodes.
Implementations§
Source§impl HttpEngine
impl HttpEngine
Sourcepub fn new(
base_url: &str,
credential: SecretString,
) -> Result<Self, HttpEngineError>
pub fn new( base_url: &str, credential: SecretString, ) -> Result<Self, HttpEngineError>
Connect to one UQA data-plane origin.
Plain HTTP is accepted only for loopback local nodes. Cloud endpoints must use HTTPS.
Sourcepub fn from_env() -> Result<Self, HttpEngineError>
pub fn from_env() -> Result<Self, HttpEngineError>
Read UQA_URL and UQA_TOKEN, as emitted by uqa ... connection --format env.
Sourcepub async fn local(project: &str) -> Result<Self, HttpEngineError>
pub async fn local(project: &str) -> Result<Self, HttpEngineError>
Resolve a local project through the installed uqa CLI, then connect to its data plane.
The CLI is invoked only during construction. Subsequent SQL calls use HTTP directly.
Sourcepub async fn local_with_cli(
project: &str,
cli_path: impl AsRef<OsStr>,
) -> Result<Self, HttpEngineError>
pub async fn local_with_cli( project: &str, cli_path: impl AsRef<OsStr>, ) -> Result<Self, HttpEngineError>
Resolve a local project through a specific uqa CLI executable.
Sourcepub async fn cloud(
project: &str,
organization: Option<&str>,
) -> Result<Self, HttpEngineError>
pub async fn cloud( project: &str, organization: Option<&str>, ) -> Result<Self, HttpEngineError>
Resolve a Cloud project and optional organization through the installed uqa CLI.
Passing None uses the CLI’s current default organization. The CLI is invoked only during
construction; subsequent SQL calls use HTTP directly.
Sourcepub async fn cloud_with_cli(
project: &str,
organization: Option<&str>,
cli_path: impl AsRef<OsStr>,
) -> Result<Self, HttpEngineError>
pub async fn cloud_with_cli( project: &str, organization: Option<&str>, cli_path: impl AsRef<OsStr>, ) -> Result<Self, HttpEngineError>
Resolve a Cloud project through a specific uqa CLI executable.
Sourcepub async fn sql(
&self,
query: &str,
params: &[SQLParam],
) -> Result<SQLResult, HttpEngineError>
pub async fn sql( &self, query: &str, params: &[SQLParam], ) -> Result<SQLResult, HttpEngineError>
Execute one materialized SQL statement through POST /v1/sql.
Sourcepub async fn sql_with_metadata(
&self,
query: &str,
params: &[SQLParam],
) -> Result<SQLExecution, HttpEngineError>
pub async fn sql_with_metadata( &self, query: &str, params: &[SQLParam], ) -> Result<SQLExecution, HttpEngineError>
Execute one materialized SQL statement and preserve its request ID.
Sourcepub async fn sql_batch(
&self,
statements: &[(&str, &[SQLParam])],
) -> Result<Vec<SQLResult>, HttpEngineError>
pub async fn sql_batch( &self, statements: &[(&str, &[SQLParam])], ) -> Result<Vec<SQLResult>, HttpEngineError>
Execute every statement atomically through POST /v1/sql/batch.
Sourcepub async fn sql_batch_with_metadata(
&self,
statements: &[(&str, &[SQLParam])],
) -> Result<SQLBatchExecution, HttpEngineError>
pub async fn sql_batch_with_metadata( &self, statements: &[(&str, &[SQLParam])], ) -> Result<SQLBatchExecution, HttpEngineError>
Execute an atomic SQL batch and preserve its request ID.
Sourcepub async fn sql_stream(
&self,
query: &str,
params: &[SQLParam],
) -> Result<SQLStream, HttpEngineError>
pub async fn sql_stream( &self, query: &str, params: &[SQLParam], ) -> Result<SQLStream, HttpEngineError>
Start an incremental SQL request through POST /v1/sql/stream.
Trait Implementations§
Source§impl AsyncSQLEngine for HttpEngine
impl AsyncSQLEngine for HttpEngine
Source§impl Clone for HttpEngine
impl Clone for HttpEngine
Source§fn clone(&self) -> HttpEngine
fn clone(&self) -> HttpEngine
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for HttpEngine
impl !UnwindSafe for HttpEngine
impl Freeze for HttpEngine
impl Send for HttpEngine
impl Sync for HttpEngine
impl Unpin for HttpEngine
impl UnsafeUnpin for HttpEngine
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
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> ⓘ
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> ⓘ
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 more