pub struct ValuesQuerySet<T: Model> { /* private fields */ }Expand description
Pure-projection queryset returned by QuerySet::values_dict.
Compiles to a SELECT <cols> FROM … with the WHERE / ORDER BY /
LIMIT / OFFSET / set-algebra branches of the underlying queryset
preserved. The terminal is Self::fetch, added by the executor.
Implementations§
Source§impl<T: Model> ValuesQuerySet<T>
impl<T: Model> ValuesQuerySet<T>
Sourcepub fn compile(self) -> Result<SelectQuery, QueryError>
pub fn compile(self) -> Result<SelectQuery, QueryError>
Compile to a SelectQuery with projection set to the
validated column list.
§Errors
QueryError::EmptyValuesProjectionifcolsis empty.QueryError::UnknownFieldif any column doesn’t exist on the model.- Anything
QuerySet::compilesurfaces.
Sourcepub fn columns(&self) -> &[&'static str]
pub fn columns(&self) -> &[&'static str]
The validated column list, so the fetch in crate::sql can
pass it to the row decoder.
Source§impl<T: Model> ValuesQuerySet<T>
impl<T: Model> ValuesQuerySet<T>
Source§impl<T: Model> ValuesQuerySet<T>
impl<T: Model> ValuesQuerySet<T>
Sourcepub async fn fetch_on<'c, E>(
self,
executor: E,
) -> Result<Vec<HashMap<String, SqlValue>>, ExecError>
pub async fn fetch_on<'c, E>( self, executor: E, ) -> Result<Vec<HashMap<String, SqlValue>>, ExecError>
Self::fetch on a borrowed executor instead of the pool.
Use it for a tenant-scoped query: a schema-mode tenant is
selected by SET search_path on one connection, so going
through the pool would read public instead.
§Errors
As Self::fetch.
Auto Trait Implementations§
impl<T> Freeze for ValuesQuerySet<T>
impl<T> RefUnwindSafe for ValuesQuerySet<T>where
QuerySet<T>: RefUnwindSafe,
impl<T> Send for ValuesQuerySet<T>
impl<T> Sync for ValuesQuerySet<T>
impl<T> Unpin for ValuesQuerySet<T>
impl<T> UnsafeUnpin for ValuesQuerySet<T>where
QuerySet<T>: UnsafeUnpin,
impl<T> UnwindSafe for ValuesQuerySet<T>where
QuerySet<T>: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
Converts
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> ⓘ
Converts
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