pub struct QueryBuilder<'hlx, 'a, R> { /* private fields */ }Expand description
Fluent builder for a single request, produced by Client::query.
Optional server header toggles (writer_only,
warm_only,
should_await_durability) can be chained,
then query transitions to a QueryExecutionRequest ready
to send.
R is the response deserialization target carried through to send().
Implementations§
Source§impl<'hlx, 'a, R> QueryBuilder<'hlx, 'a, R>
impl<'hlx, 'a, R> QueryBuilder<'hlx, 'a, R>
Sourcepub fn new(client: &'hlx HelixDBClient) -> Self
pub fn new(client: &'hlx HelixDBClient) -> Self
Create a builder seeded with the Content-Type: application/json header.
Prefer Client::query, which calls this for you.
Sourcepub fn writer_only(self) -> Self
pub fn writer_only(self) -> Self
Require the request to be served by a writer node.
Sets the x-helix-require-writer header.
Sourcepub fn warm_only(self) -> Self
pub fn warm_only(self) -> Self
Only execute if the query is already warm (reads only).
Sets the x-helix-warm header.
Sourcepub fn should_await_durability(self, should: bool) -> Self
pub fn should_await_durability(self, should: bool) -> Self
Choose whether a write request blocks until the write is durable.
Sets the x-helix-await-durable header to "true" or "false".
Sourcepub fn query(self, query: QueryRequest) -> QueryExecutionRequest<'hlx, 'a, R>
pub fn query(self, query: QueryRequest) -> QueryExecutionRequest<'hlx, 'a, R>
Target the query route at /v2/query.
The QueryRequest (DSL query plus parameters) is serialized as
the request body. Build one directly or with a #[query] helper, then
call QueryExecutionRequest::send.