Skip to main content

Module query

Module query 

Source
Expand description

SurrealQL statement builders.

Each builder is reached from Table (itself produced by the derived Type::table()) and rendered to a string with to_surrealql():

Mutations also offer then_select(...) to chain a reselect as a batch.

Structs§

Batch
Concatenates SurrealQL statements with ; separators. The store’s typical pattern is a mutation followed by a SELECT that re-projects the row.
Create
CREATE <target> [CONTENT … | SET …] [RETURN …].
Delete
A DELETE <target> [WHERE …] [RETURN …] builder.
Insert
An INSERT INTO <table> … builder. Records are serialized inline as object literals; rendering requires T: serde::Serialize.
Relate
Builds a graph edge statement RELATE a -> edge -> b for an edge type E. For edges that carry their own fields, see RelateEdge.
RelateEdge
Build a RELATE query with edge content.
Select
A SELECT statement builder: projections, WHERE, ORDER BY, LIMIT, START, FETCH, GROUP BY/GROUP ALL, and count().
Table
Entry point to the query builder for a record type T — the value returned by the derived T::table(). Each method starts a statement builder.
Update
An UPDATE/UPSERT builder: SET / MERGE / CONTENT, an optional WHERE, and RETURN. Built via Table::update or Table::upsert.

Enums§

Returning
How a mutating statement should return its affected rows.