pub struct Query<T> { /* private fields */ }Expand description
A query over one template, compiled to parameterized SQL.
The template comes from the type, so the qname is never typed out:
ⓘ
let sql = Query::<AppInstallRequest>::active()
.filter(Predicate::eq("user", party))
.limit(100)
.compile();Implementations§
Source§impl<T: Contract> Query<T>
impl<T: Contract> Query<T>
Sourcepub fn active_at(offset: i64) -> Self
pub fn active_at(offset: i64) -> Self
Contracts of this template that were active as of an offset.
What makes a paged or repeated read consistent: the ACS at a point, rather than a target that moves between calls.
Sourcepub fn creates(from: Option<i64>, to: Option<i64>) -> Self
pub fn creates(from: Option<i64>, to: Option<i64>) -> Self
Contracts of this template created between two offsets.
None on either side keeps the store’s own default — its oldest
retained offset, and its latest.
Sourcepub fn archives(from: Option<i64>, to: Option<i64>) -> Self
pub fn archives(from: Option<i64>, to: Option<i64>) -> Self
Contracts of this template archived between two offsets.
Sourcepub fn qname() -> String
pub fn qname() -> String
The qname PQS knows this template by: <package>:<Module>:<Entity>.
The package name, not its id — which is what makes a query survive a Smart Contract Upgrade instead of pinning one build.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Query<T>
impl<T> RefUnwindSafe for Query<T>
impl<T> Send for Query<T>
impl<T> Sync for Query<T>
impl<T> Unpin for Query<T>
impl<T> UnsafeUnpin for Query<T>
impl<T> UnwindSafe for Query<T>
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request