pub struct ValuesQuery {
pub with: With,
pub values: Values,
pub order_by: OrderBy,
pub limit: Limit,
pub offset: Offset,
pub fetch: Fetch,
pub combines: Combines,
}Expand description
A standalone PostgreSQL VALUES statement.
From https://www.postgresql.org/docs/17/sql-values.html:
VALUES ( expression [, ...] ) [, ...]
[ ORDER BY sort_expression [ ASC | DESC | USING operator ] [, ...] ]
[ LIMIT { count | ALL } ]
[ OFFSET start [ ROW | ROWS ] ]
[ FETCH { FIRST | NEXT } [ count ] { ROW | ROWS } { ONLY | WITH TIES } ]VALUES is a simple_select alternative in gram.y, so it also takes a
leading WITH and participates in set operations — VALUES (1) UNION SELECT … — and the tail clauses of a combination live in Combines, as
they do for a SELECT. The columns of the result are named column1,
column2, …, which is what an ORDER BY here refers to (or ORDER BY 1).
It has no FOR UPDATE: PostgreSQL rejects a locking clause on VALUES, so
HasLocks is not implemented and values::for_update does not exist.
The rows are the same Values clause an INSERT holds, minus its
query alternative: a standalone VALUES is rows, so a
Values::query set here is a recorded build error rather than something to
render around.
Fields§
§with: WithWITH ….
values: ValuesThe rows.
order_by: OrderByORDER BY … — this statement’s own.
limit: LimitLIMIT … — this statement’s own.
offset: OffsetOFFSET … — this statement’s own.
fetch: FetchFETCH … — this statement’s own.
combines: CombinesThe set operations, and the trailing clauses that belong to their result.
Implementations§
Source§impl ValuesQuery
impl ValuesQuery
Sourcepub fn new() -> ValuesQuery
pub fn new() -> ValuesQuery
A VALUES with no rows yet — which does not build until it has one.
Sourcepub fn apply(&mut self, mods: impl Mod<ValuesQuery>)
pub fn apply(&mut self, mods: impl Mod<ValuesQuery>)
Apply more mods to an existing query.
Trait Implementations§
Source§impl Clone for ValuesQuery
impl Clone for ValuesQuery
Source§fn clone(&self) -> ValuesQuery
fn clone(&self) -> ValuesQuery
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ValuesQuery
impl Debug for ValuesQuery
Source§impl Default for ValuesQuery
impl Default for ValuesQuery
Source§fn default() -> ValuesQuery
fn default() -> ValuesQuery
Source§impl Expression for ValuesQuery
impl Expression for ValuesQuery
Source§impl HasCombines for ValuesQuery
impl HasCombines for ValuesQuery
Source§fn combines_mut(&mut self) -> &mut Combines
fn combines_mut(&mut self) -> &mut Combines
Source§impl HasFetch for ValuesQuery
impl HasFetch for ValuesQuery
Source§impl HasLimit for ValuesQuery
impl HasLimit for ValuesQuery
Source§impl HasOffset for ValuesQuery
impl HasOffset for ValuesQuery
Source§fn offset_mut(&mut self) -> &mut Offset
fn offset_mut(&mut self) -> &mut Offset
OFFSET clause to modify.Source§impl HasOrderBy for ValuesQuery
impl HasOrderBy for ValuesQuery
Source§fn order_by_mut(&mut self) -> &mut OrderBy
fn order_by_mut(&mut self) -> &mut OrderBy
ORDER BY clause to modify.