Struct rqlite_client::Query
source · pub struct Query<'a, T>where
T: State,{ /* private fields */ }
Expand description
Builder for the SQL statement Query
The preferred way to create a Query
is via methods of the Connection
, depending of the intention:
A Query
will be transitioned between different consistency state levels:
NoLevel
LevelNone
LevelStrong
LevelWeak
NoLevel
and LevelWeak
have the same effect for the Query
and its Response
.
If there are pushed multiple SQL statements, there are state levels ending with Multi. These queries need to use an HTTP POST request to the database backend.
For more information about the state levels, see ConsistencyLevel
.
To set SQL statements use the most appropriate method of the set_sql_...()
or push_sql_...()
group.
For being safe against SQL injection preferable use parameterized statements.
For convenience with different types of parameters, there is the crate::varparam!
-macro.
Implementations§
source§impl Query<'_, Nodes>
impl Query<'_, Nodes>
sourcepub fn enable_nonvoters(self) -> Self
pub fn enable_nonvoters(self) -> Self
Enable nonvoters query param to check also read-only nodes
See https://rqlite.io/docs/guides/monitoring-rqlite/#nodes-api
source§impl Query<'_, Readyz>
impl Query<'_, Readyz>
sourcepub fn enable_noleader(self) -> Self
pub fn enable_noleader(self) -> Self
Enable noleader query param to check all nodes, regardless of Leader status
See https://rqlite.io/docs/guides/monitoring-rqlite/#readiness-checks
source§impl<'a, T> Query<'a, T>where
T: State,
impl<'a, T> Query<'a, T>where
T: State,
sourcepub fn connection(&self) -> &'a Connection
pub fn connection(&self) -> &'a Connection
Connection
of Query
sourcepub fn consistency_level(&self) -> Option<ConsistencyLevel>
pub fn consistency_level(&self) -> Option<ConsistencyLevel>
ConsistencyLevel
of Query
or None
sourcepub fn disable_redirect(self) -> Self
pub fn disable_redirect(self) -> Self
Disable automatic redirect forwarding
See https://rqlite.io/docs/api/api/#disabling-request-forwarding
sourcepub fn is_associative(&self) -> bool
pub fn is_associative(&self) -> bool
Check for associative Query
See https://rqlite.io/docs/api/api/#associative-response-form
sourcepub fn is_noleader(&self) -> bool
pub fn is_noleader(&self) -> bool
Check for readiness noleader
query flag status
See https://rqlite.io/docs/guides/monitoring-rqlite/#readiness-checks
sourcepub fn is_nonvoters(&self) -> bool
pub fn is_nonvoters(&self) -> bool
Check for nodes nonvoter
query flag status
See https://rqlite.io/docs/guides/monitoring-rqlite/#nodes-api
sourcepub fn is_pretty(&self) -> bool
pub fn is_pretty(&self) -> bool
Check for pretty Query
The use of the URL param pretty is optional, and results in pretty-printed JSON responses.
Makes only sense during debug, because it is more verbose in memory and speed.
sourcepub fn is_queue(&self) -> bool
pub fn is_queue(&self) -> bool
Check for queued Query
rqlite exposes a special API flag, which will instruct rqlite to queue up write-requests
and execute them asynchronously.
rqlite will merge the requests, once a batch-size of them has been queued on the node or a
configurable timeout expires, and execute them as though they had been both contained in a
single request.
Each response includes a monotonically-increasing sequence_number
, which allows to track
the persisting of the data with the Endpoint::Status
.
With Query::is_wait()
true, the data has been persisted when the
response::Result
is available and successful.
sourcepub fn is_redirect(&self) -> bool
pub fn is_redirect(&self) -> bool
Check for automatic redirect forwarding [[default: true]]
See https://rqlite.io/docs/api/api/#disabling-request-forwarding
The url path param indicates a disabled redirect, but we use it
here in the sense of the word.
So when path param should be set, this needs to return false
.
sourcepub fn is_timing(&self) -> bool
pub fn is_timing(&self) -> bool
Check for timing Query
Time is measured in seconds. If you do not want timings, do not pass timings as a URL parameter.
sourcepub fn is_transaction(&self) -> bool
pub fn is_transaction(&self) -> bool
Check for enabled transaction
A form of transactions are supported. To execute statements within a transaction, add transaction to the URL.
When a transaction takes place either all statements of a Query
will succeed, or neither.
Performance is much, much better if multiple SQL INSERTs or UPDATEs are executed via a transaction.
Note that processing of the request ceases the moment any single query results in an error.
The behaviour of rqlite if you explicitly issue BEGIN, COMMIT, ROLLBACK, SAVEPOINT, and RELEASE to control
your own transactions is not defined.
This is because the behavior of a cluster if it fails while such a manually-controlled transaction is not
yet defined.
It is important to control transactions only through this query parameter.
sourcepub fn is_wait(&self) -> bool
pub fn is_wait(&self) -> bool
Check for awaited queued Query
When Query::is_queue()
true, rqlite will merge the requests, once a batch-size of them has been queued
on the node or a configurable timeout expires, and execute them as though they had been both contained in
a single request.
The wait
can explicitly tell the request to wait until the queue has persisted all pending requests.
See https://rqlite.io/docs/api/queued-writes/#waiting-for-a-queue-to-flush
sourcepub fn set_associative(self) -> Self
pub fn set_associative(self) -> Self
Check for associative Query
See https://rqlite.io/docs/api/api/#associative-response-form
sourcepub fn set_pretty(self) -> Self
pub fn set_pretty(self) -> Self
Set pretty Query
The use of the URL param pretty is optional, and results in pretty-printed JSON responses. Makes only sense during debug, because it is more verbose in memory and speed.
sourcepub fn set_timeout(self, timeout: Timeout) -> Self
pub fn set_timeout(self, timeout: Timeout) -> Self
Set timeout
for Query
response
See https://rqlite.io/docs/api/api/#request-forwarding-timeouts and see https://rqlite.io/docs/api/queued-writes/#waiting-for-a-queue-to-flush
sourcepub fn set_timeout_request(self, timeout_request: Duration) -> Self
pub fn set_timeout_request(self, timeout_request: Duration) -> Self
Set timeout_request
for HTTP request of Query
sourcepub fn set_timing(self) -> Self
pub fn set_timing(self) -> Self
Set timing in Query
Time is measured in seconds. If you do not want timings, do not pass timings as a URL parameter.
sourcepub fn timeout_request(&self) -> Option<&Duration>
pub fn timeout_request(&self) -> Option<&Duration>
Get optional timeout
for HTTP request of Query
sourcepub fn is_sql_str_query(&self) -> bool
pub fn is_sql_str_query(&self) -> bool
Checks if sql
is possible to use in an url query parameter
source§impl<'a> Query<'a, LevelNone>
impl<'a> Query<'a, LevelNone>
Query<state::LevelNone>
See Query
sourcepub fn push_sql(self, sql: Value) -> Query<'a, LevelNoneMulti>
pub fn push_sql(self, sql: Value) -> Query<'a, LevelNoneMulti>
Append a given sql
to the Query<state::LevelNone>
§Panics
If consistency_level
is not set before (report internal bug)
sourcepub fn push_sql_str(self, sql: &str) -> Query<'a, LevelNoneMulti>
pub fn push_sql_str(self, sql: &str) -> Query<'a, LevelNoneMulti>
Append a given sql
to the Query<state::LevelNone>
§Panics
If consistency_level
is not set before (report internal bug)
sourcepub fn push_sql_str_slice(self, sql: &[&str]) -> Query<'a, LevelNoneMulti>
pub fn push_sql_str_slice(self, sql: &[&str]) -> Query<'a, LevelNoneMulti>
Append a given sql
to the Query<state::LevelNone>
§Panics
If consistency_level
is not set before (report internal bug)
sourcepub fn push_sql_values<V>(self, sql: &[V]) -> Query<'a, LevelNoneMulti>
pub fn push_sql_values<V>(self, sql: &[V]) -> Query<'a, LevelNoneMulti>
Append a given sql
to the Query<state::LevelNone>
§Panics
If consistency_level
is not set before (report internal bug)
sourcepub fn set_sql_str(self, sql: &str) -> Self
pub fn set_sql_str(self, sql: &str) -> Self
Set a given sql
to the Query<state::LevelNone>
sourcepub fn set_sql_str_slice(self, sql: &[&str]) -> Self
pub fn set_sql_str_slice(self, sql: &[&str]) -> Self
Set a given sql
to the Query<state::LevelNone>
source§impl Query<'_, LevelNoneMulti>
impl Query<'_, LevelNoneMulti>
Query<state::LevelNoneMulti>
See Query
sourcepub fn enable_transaction(self) -> Self
pub fn enable_transaction(self) -> Self
Enable transaction
A form of transactions are supported. To execute statements within a transaction, add transaction to the URL.
When a transaction takes place either all statements of a Query
will succeed, or neither.
Performance is much, much better if multiple SQL INSERTs or UPDATEs are executed via a transaction.
Note that processing of the request ceases the moment any single query results in an error.
The behaviour of rqlite if you explicitly issue BEGIN, COMMIT, ROLLBACK, SAVEPOINT, and RELEASE to controlyour own transactions is not defined.
This is because the behavior of a cluster if it fails while such a manually-controlled transaction is notyet defined.
It is important to control transactions only through this query parameter.
sourcepub fn push_sql(self, sql: Value) -> Self
pub fn push_sql(self, sql: Value) -> Self
Append a given sql
to the Query<state::LevelNoneMulti>
sourcepub fn push_sql_str(self, sql: &str) -> Self
pub fn push_sql_str(self, sql: &str) -> Self
Append a given sql
to the Query<state::LevelNoneMulti>
sourcepub fn push_sql_str_slice(self, sql: &[&str]) -> Self
pub fn push_sql_str_slice(self, sql: &[&str]) -> Self
Append a given sql
to the Query<state::LevelNoneMulti>
source§impl Query<'_, LevelNone>
impl Query<'_, LevelNone>
Query<state::LevelNone>
See Query
sourcepub fn freshness(&self) -> Option<Freshness>
pub fn freshness(&self) -> Option<Freshness>
Freshness
of Query<state::LevelNone>
or None
The amount of time the database node is allowed for not checking the leader for
data accuracy.
If data is stale, there will be an error response.
See Freshness
for more details.
sourcepub fn set_freshness(self, freshness: impl Into<Freshness>) -> Self
pub fn set_freshness(self, freshness: impl Into<Freshness>) -> Self
Set Freshness
of Query<state::LevelNone>
Sets the amount of time the database node is allowed for not checking the leader for
data accuracy.
If data is stale, there will be an error response.
See Freshness
for more details.
source§impl Query<'_, LevelNoneMulti>
impl Query<'_, LevelNoneMulti>
Query<state::LevelNoneMulti>
See Query
sourcepub fn freshness(&self) -> Option<Freshness>
pub fn freshness(&self) -> Option<Freshness>
Freshness
of Query<state::LevelNoneMulti>
or None
The amount of time the database node is allowed for not checking the leader for
data accuracy.
If data is stale, there will be an error response.
See Freshness
for more details.
sourcepub fn set_freshness(self, freshness: impl Into<Freshness>) -> Self
pub fn set_freshness(self, freshness: impl Into<Freshness>) -> Self
Set Freshness
of Query<state::LevelNoneMulti>
Sets the amount of time the database node is allowed for not checking the leader for
data accuracy.
If data is stale, there will be an error response.
See Freshness
for more details.
source§impl<'a> Query<'a, LevelNone>
impl<'a> Query<'a, LevelNone>
Query<LevelNone>
See Query
sourcepub fn set_strong(self) -> Query<'a, LevelStrong>
pub fn set_strong(self) -> Query<'a, LevelStrong>
Set ConsistencyLevel::Strong
for Query
sourcepub fn set_weak(self) -> Query<'a, LevelWeak>
pub fn set_weak(self) -> Query<'a, LevelWeak>
Set ConsistencyLevel::Weak
for Query
source§impl<'a> Query<'a, LevelNoneMulti>
impl<'a> Query<'a, LevelNoneMulti>
Query<LevelNoneMulti>
See Query
sourcepub fn set_strong(self) -> Query<'a, LevelStrongMulti>
pub fn set_strong(self) -> Query<'a, LevelStrongMulti>
Set ConsistencyLevel::Strong
for Query
sourcepub fn set_weak(self) -> Query<'a, LevelWeakMulti>
pub fn set_weak(self) -> Query<'a, LevelWeakMulti>
Set ConsistencyLevel::Weak
for Query
source§impl<'a> Query<'a, LevelStrong>
impl<'a> Query<'a, LevelStrong>
Query<state::LevelStrong>
See Query
sourcepub fn push_sql(self, sql: Value) -> Query<'a, LevelStrongMulti>
pub fn push_sql(self, sql: Value) -> Query<'a, LevelStrongMulti>
Append a given sql
to the Query<state::LevelStrong>
§Panics
If consistency_level
is not set before (report internal bug)
sourcepub fn push_sql_str(self, sql: &str) -> Query<'a, LevelStrongMulti>
pub fn push_sql_str(self, sql: &str) -> Query<'a, LevelStrongMulti>
Append a given sql
to the Query<state::LevelStrong>
§Panics
If consistency_level
is not set before (report internal bug)
sourcepub fn push_sql_str_slice(self, sql: &[&str]) -> Query<'a, LevelStrongMulti>
pub fn push_sql_str_slice(self, sql: &[&str]) -> Query<'a, LevelStrongMulti>
Append a given sql
to the Query<state::LevelStrong>
§Panics
If consistency_level
is not set before (report internal bug)
sourcepub fn push_sql_values<V>(self, sql: &[V]) -> Query<'a, LevelStrongMulti>
pub fn push_sql_values<V>(self, sql: &[V]) -> Query<'a, LevelStrongMulti>
Append a given sql
to the Query<state::LevelStrong>
§Panics
If consistency_level
is not set before (report internal bug)
sourcepub fn set_sql_str(self, sql: &str) -> Self
pub fn set_sql_str(self, sql: &str) -> Self
Set a given sql
to the Query<state::LevelStrong>
sourcepub fn set_sql_str_slice(self, sql: &[&str]) -> Self
pub fn set_sql_str_slice(self, sql: &[&str]) -> Self
Set a given sql
to the Query<state::LevelStrong>
source§impl Query<'_, LevelStrongMulti>
impl Query<'_, LevelStrongMulti>
Query<state::LevelStrongMulti>
See Query
sourcepub fn enable_transaction(self) -> Self
pub fn enable_transaction(self) -> Self
Enable transaction
A form of transactions are supported. To execute statements within a transaction, add transaction to the URL.
When a transaction takes place either all statements of a Query
will succeed, or neither.
Performance is much, much better if multiple SQL INSERTs or UPDATEs are executed via a transaction.
Note that processing of the request ceases the moment any single query results in an error.
The behaviour of rqlite if you explicitly issue BEGIN, COMMIT, ROLLBACK, SAVEPOINT, and RELEASE to controlyour own transactions is not defined.
This is because the behavior of a cluster if it fails while such a manually-controlled transaction is notyet defined.
It is important to control transactions only through this query parameter.
sourcepub fn push_sql(self, sql: Value) -> Self
pub fn push_sql(self, sql: Value) -> Self
Append a given sql
to the Query<state::LevelStrongMulti>
sourcepub fn push_sql_str(self, sql: &str) -> Self
pub fn push_sql_str(self, sql: &str) -> Self
Append a given sql
to the Query<state::LevelStrongMulti>
sourcepub fn push_sql_str_slice(self, sql: &[&str]) -> Self
pub fn push_sql_str_slice(self, sql: &[&str]) -> Self
Append a given sql
to the Query<state::LevelStrongMulti>
source§impl<'a> Query<'a, LevelStrong>
impl<'a> Query<'a, LevelStrong>
Query<LevelStrong>
See Query
sourcepub fn set_none(self) -> Query<'a, LevelNone>
pub fn set_none(self) -> Query<'a, LevelNone>
Set ConsistencyLevel::None
for Query
sourcepub fn set_weak(self) -> Query<'a, LevelWeak>
pub fn set_weak(self) -> Query<'a, LevelWeak>
Set ConsistencyLevel::Weak
for Query
source§impl<'a> Query<'a, LevelStrongMulti>
impl<'a> Query<'a, LevelStrongMulti>
Query<LevelStrongMulti>
See Query
sourcepub fn set_none(self) -> Query<'a, LevelNoneMulti>
pub fn set_none(self) -> Query<'a, LevelNoneMulti>
Set ConsistencyLevel::None
for Query
sourcepub fn set_weak(self) -> Query<'a, LevelWeakMulti>
pub fn set_weak(self) -> Query<'a, LevelWeakMulti>
Set ConsistencyLevel::Weak
for Query
source§impl<'a> Query<'a, LevelWeak>
impl<'a> Query<'a, LevelWeak>
Query<state::LevelWeak>
See Query
sourcepub fn push_sql(self, sql: Value) -> Query<'a, LevelWeakMulti>
pub fn push_sql(self, sql: Value) -> Query<'a, LevelWeakMulti>
Append a given sql
to the Query<state::LevelWeak>
§Panics
If consistency_level
is not set before (report internal bug)
sourcepub fn push_sql_str(self, sql: &str) -> Query<'a, LevelWeakMulti>
pub fn push_sql_str(self, sql: &str) -> Query<'a, LevelWeakMulti>
Append a given sql
to the Query<state::LevelWeak>
§Panics
If consistency_level
is not set before (report internal bug)
sourcepub fn push_sql_str_slice(self, sql: &[&str]) -> Query<'a, LevelWeakMulti>
pub fn push_sql_str_slice(self, sql: &[&str]) -> Query<'a, LevelWeakMulti>
Append a given sql
to the Query<state::LevelWeak>
§Panics
If consistency_level
is not set before (report internal bug)
sourcepub fn push_sql_values<V>(self, sql: &[V]) -> Query<'a, LevelWeakMulti>
pub fn push_sql_values<V>(self, sql: &[V]) -> Query<'a, LevelWeakMulti>
Append a given sql
to the Query<state::LevelWeak>
§Panics
If consistency_level
is not set before (report internal bug)
sourcepub fn set_sql_str(self, sql: &str) -> Self
pub fn set_sql_str(self, sql: &str) -> Self
Set a given sql
to the Query<state::LevelWeak>
sourcepub fn set_sql_str_slice(self, sql: &[&str]) -> Self
pub fn set_sql_str_slice(self, sql: &[&str]) -> Self
Set a given sql
to the Query<state::LevelWeak>
source§impl Query<'_, LevelWeakMulti>
impl Query<'_, LevelWeakMulti>
Query<state::LevelWeakMulti>
See Query
sourcepub fn enable_transaction(self) -> Self
pub fn enable_transaction(self) -> Self
Enable transaction
A form of transactions are supported. To execute statements within a transaction, add transaction to the URL.
When a transaction takes place either all statements of a Query
will succeed, or neither.
Performance is much, much better if multiple SQL INSERTs or UPDATEs are executed via a transaction.
Note that processing of the request ceases the moment any single query results in an error.
The behaviour of rqlite if you explicitly issue BEGIN, COMMIT, ROLLBACK, SAVEPOINT, and RELEASE to controlyour own transactions is not defined.
This is because the behavior of a cluster if it fails while such a manually-controlled transaction is notyet defined.
It is important to control transactions only through this query parameter.
sourcepub fn push_sql(self, sql: Value) -> Self
pub fn push_sql(self, sql: Value) -> Self
Append a given sql
to the Query<state::LevelWeakMulti>
sourcepub fn push_sql_str(self, sql: &str) -> Self
pub fn push_sql_str(self, sql: &str) -> Self
Append a given sql
to the Query<state::LevelWeakMulti>
sourcepub fn push_sql_str_slice(self, sql: &[&str]) -> Self
pub fn push_sql_str_slice(self, sql: &[&str]) -> Self
Append a given sql
to the Query<state::LevelWeakMulti>
source§impl<'a> Query<'a, LevelWeak>
impl<'a> Query<'a, LevelWeak>
Query<LevelWeak>
See Query
sourcepub fn set_none(self) -> Query<'a, LevelNone>
pub fn set_none(self) -> Query<'a, LevelNone>
Set ConsistencyLevel::None
for Query
sourcepub fn set_strong(self) -> Query<'a, LevelStrong>
pub fn set_strong(self) -> Query<'a, LevelStrong>
Set ConsistencyLevel::Strong
for Query
source§impl<'a> Query<'a, LevelWeakMulti>
impl<'a> Query<'a, LevelWeakMulti>
Query<LevelWeakMulti>
See Query
sourcepub fn set_none(self) -> Query<'a, LevelNoneMulti>
pub fn set_none(self) -> Query<'a, LevelNoneMulti>
Set ConsistencyLevel::None
for Query
sourcepub fn set_strong(self) -> Query<'a, LevelStrongMulti>
pub fn set_strong(self) -> Query<'a, LevelStrongMulti>
Set ConsistencyLevel::Strong
for Query
source§impl<'a> Query<'a, NoLevel>
impl<'a> Query<'a, NoLevel>
Query<state::NoLevel>
See Query
sourcepub fn push_sql(self, sql: Value) -> Query<'a, NoLevelMulti>
pub fn push_sql(self, sql: Value) -> Query<'a, NoLevelMulti>
Append a given sql
to the Query<state::NoLevel>
§Panics
If consistency_level
is not set before (report internal bug)
sourcepub fn push_sql_str(self, sql: &str) -> Query<'a, NoLevelMulti>
pub fn push_sql_str(self, sql: &str) -> Query<'a, NoLevelMulti>
Append a given sql
to the Query<state::NoLevel>
§Panics
If consistency_level
is not set before (report internal bug)
sourcepub fn push_sql_str_slice(self, sql: &[&str]) -> Query<'a, NoLevelMulti>
pub fn push_sql_str_slice(self, sql: &[&str]) -> Query<'a, NoLevelMulti>
Append a given sql
to the Query<state::NoLevel>
§Panics
If consistency_level
is not set before (report internal bug)
sourcepub fn push_sql_values<V>(self, sql: &[V]) -> Query<'a, NoLevelMulti>
pub fn push_sql_values<V>(self, sql: &[V]) -> Query<'a, NoLevelMulti>
Append a given sql
to the Query<state::NoLevel>
§Panics
If consistency_level
is not set before (report internal bug)
sourcepub fn set_sql_str(self, sql: &str) -> Self
pub fn set_sql_str(self, sql: &str) -> Self
Set a given sql
to the Query<state::NoLevel>
sourcepub fn set_sql_str_slice(self, sql: &[&str]) -> Self
pub fn set_sql_str_slice(self, sql: &[&str]) -> Self
Set a given sql
to the Query<state::NoLevel>
source§impl Query<'_, NoLevelMulti>
impl Query<'_, NoLevelMulti>
Query<state::NoLevelMulti>
See Query
sourcepub fn enable_transaction(self) -> Self
pub fn enable_transaction(self) -> Self
Enable transaction
A form of transactions are supported. To execute statements within a transaction, add transaction to the URL.
When a transaction takes place either all statements of a Query
will succeed, or neither.
Performance is much, much better if multiple SQL INSERTs or UPDATEs are executed via a transaction.
Note that processing of the request ceases the moment any single query results in an error.
The behaviour of rqlite if you explicitly issue BEGIN, COMMIT, ROLLBACK, SAVEPOINT, and RELEASE to controlyour own transactions is not defined.
This is because the behavior of a cluster if it fails while such a manually-controlled transaction is notyet defined.
It is important to control transactions only through this query parameter.
sourcepub fn push_sql_str(self, sql: &str) -> Self
pub fn push_sql_str(self, sql: &str) -> Self
Append a given sql
to the Query<state::NoLevelMulti>
sourcepub fn push_sql_str_slice(self, sql: &[&str]) -> Self
pub fn push_sql_str_slice(self, sql: &[&str]) -> Self
Append a given sql
to the Query<state::NoLevelMulti>
source§impl<'a> Query<'a, NoLevel>
impl<'a> Query<'a, NoLevel>
Query<NoLevel>
See Query
sourcepub fn monitor(self) -> Query<'a, Monitor>
pub fn monitor(self) -> Query<'a, Monitor>
Get a Query
to monitor::Monitor
rqlited
sourcepub fn set_none(self) -> Query<'a, LevelNone>
pub fn set_none(self) -> Query<'a, LevelNone>
Set ConsistencyLevel::None
for Query
sourcepub fn set_strong(self) -> Query<'a, LevelStrong>
pub fn set_strong(self) -> Query<'a, LevelStrong>
Set ConsistencyLevel::Strong
for Query
sourcepub fn set_weak(self) -> Query<'a, LevelWeak>
pub fn set_weak(self) -> Query<'a, LevelWeak>
Set ConsistencyLevel::Weak
for Query
sourcepub fn switch_multi(self) -> Query<'a, NoLevelMulti>
pub fn switch_multi(self) -> Query<'a, NoLevelMulti>
source§impl<'a> Query<'a, NoLevelMulti>
impl<'a> Query<'a, NoLevelMulti>
Query<NoLevelMulti>
See Query
sourcepub fn set_none(self) -> Query<'a, LevelNoneMulti>
pub fn set_none(self) -> Query<'a, LevelNoneMulti>
Set ConsistencyLevel::None
for Query
sourcepub fn set_strong(self) -> Query<'a, LevelStrongMulti>
pub fn set_strong(self) -> Query<'a, LevelStrongMulti>
Set ConsistencyLevel::Strong
for Query
sourcepub fn set_weak(self) -> Query<'a, LevelWeakMulti>
pub fn set_weak(self) -> Query<'a, LevelWeakMulti>
Set ConsistencyLevel::Weak
for Query
source§impl<'a> Query<'a, Monitor>
impl<'a> Query<'a, Monitor>
sourcepub fn nodes(self) -> Query<'a, Nodes>
pub fn nodes(self) -> Query<'a, Nodes>
Nodes return basic information for nodes in the cluster, as seen by the node
receiving the nodes request. The receiving node will also check whether it can actually
connect to all other nodes in the cluster.
This is an effective way to determine the cluster leader, and the leader’s HTTP API address.
It can also be used to check if the cluster is basically running.
If the other nodes are reachable, it probably is.
By default, the node only checks if voting nodes are contactable.
See https://rqlite.io/docs/guides/monitoring-rqlite/#nodes-api
sourcepub fn readyz(self) -> Query<'a, Readyz>
pub fn readyz(self) -> Query<'a, Readyz>
rqlite nodes serve a ready status monitor::Endpoint::Readyz
if the node is ready to respond to database requests and cluster management operations.
If you wish to check if the node is running, and responding to HTTP requests, regardless of
Leader status, enable_noleader
.
See https://rqlite.io/docs/guides/monitoring-rqlite/#readiness-checks