pub struct QueryLimits {
pub memory_bytes: Option<usize>,
pub timeout: Option<Duration>,
pub max_rows: Option<usize>,
pub max_bytes: Option<usize>,
}Expand description
Bounds on what one query may consume and return. None means unlimited.
Fields§
§memory_bytes: Option<usize>Memory pool for the whole session, in bytes; every query draws from it and fails with
Resources exhausted instead of growing the process. With a cap set, spilling to disk
is disabled too, so a hostile query fails fast rather than filling the disk.
timeout: Option<Duration>Wall-clock budget for planning plus execution of one query.
max_rows: Option<usize>Most rows a result may carry; the rest is dropped and the result marked truncated.
max_bytes: Option<usize>Most bytes (Arrow in-memory size) a result may carry; same truncation rule.
Implementations§
Source§impl QueryLimits
impl QueryLimits
Sourcepub const SAFE_MEMORY_BYTES: usize
pub const SAFE_MEMORY_BYTES: usize
The CLI defaults: 2 GiB pool, 60 s, 10 000 rows, 16 MiB.
Sourcepub const SAFE_TIMEOUT: Duration
pub const SAFE_TIMEOUT: Duration
See Self::safe.
Sourcepub const SAFE_MAX_ROWS: usize = 10_000
pub const SAFE_MAX_ROWS: usize = 10_000
See Self::safe.
Sourcepub const SAFE_MAX_BYTES: usize
pub const SAFE_MAX_BYTES: usize
See Self::safe.
Sourcepub fn unlimited() -> QueryLimits
pub fn unlimited() -> QueryLimits
No limits at all: the pre-0.2 behaviour, and the default of AppState.
Sourcepub fn safe() -> QueryLimits
pub fn safe() -> QueryLimits
Defaults that keep one query from taking the machine down; what the CLI uses.
Sourcepub fn session_context(&self) -> Result<SessionContext, String>
pub fn session_context(&self) -> Result<SessionContext, String>
A session whose memory pool honours Self::memory_bytes (unbounded when None).
Register tables into this context, then build the state with it.
Trait Implementations§
Source§impl Clone for QueryLimits
impl Clone for QueryLimits
Source§fn clone(&self) -> QueryLimits
fn clone(&self) -> QueryLimits
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for QueryLimits
Source§impl Debug for QueryLimits
impl Debug for QueryLimits
Source§impl Default for QueryLimits
impl Default for QueryLimits
Source§fn default() -> QueryLimits
fn default() -> QueryLimits
impl Eq for QueryLimits
Source§impl PartialEq for QueryLimits
impl PartialEq for QueryLimits
impl StructuralPartialEq for QueryLimits
Auto Trait Implementations§
impl Freeze for QueryLimits
impl RefUnwindSafe for QueryLimits
impl Send for QueryLimits
impl Sync for QueryLimits
impl Unpin for QueryLimits
impl UnsafeUnpin for QueryLimits
impl UnwindSafe for QueryLimits
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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