Skip to main content

Crate queryweave_api

Crate queryweave_api 

Source
Expand description

The queryweave runtime for the API layer: the types the code generated for API types (a Filters mirror with serde, utoipa or schemars, ValidateNonNullable) names, on top of the core runtime (queryweave), which it re-exports so that code names only this crate.

Every integration is a feature, none enabled by default: serde (Deserialize / Serialize), utoipa (ToSchema) and schemars (JsonSchema) add their derives to SortDirectionDto and PageDto. A mirror’s flag needs the feature of the same name, and reports it disabled at the flag (see features). Each integration states the wire format itself (snake case directions), so they agree whichever are enabled.

Modules§

features
Which of this crate’s features are enabled, for the code generated for a mirror to check.

Structs§

ChangeSet
The names of the fields that changed, e.g. between a model and its merge-patched version.
FieldValue
A domain field to write and the value to write to it, e.g. one changed field of a merge patch.
FilterCondition
One set filter of a generated filter-options model: field operator value.
ModelData
Items (T) naming fields of the model M, e.g. the set filters of a generated filter-options model.
PageDto
A page of items, as returned by a paginated query.
SortKey
One sort key of a generated query model: sort by field in direction.

Enums§

FilterOperator
The comparison a generated filter field performs against its column.
Patch
A field of a merge patch that may also be cleared: absent from the patch, set to null, or given a value.
SortDirectionDto
The sort direction applied to the result retrieved by filters.
SortDirectionModel
How the sorting direction is evaluated. How it is expressed in a query is up to the persistence layer.
Value
A raw value to compare against or store, in a database-agnostic form.

Traits§

Boolean
A raw value the bool filter applies to.
ChangedFields
Detect changes in field values.
FilterOptionsOf
A type converting into model M’s filter options model.
Filterable
The types #[derive(Filters)] generates for a root model or a mirror, so code mirroring it names them through it instead of by name.
IntoRootQuery
The query of M (a root’s query model, or a mirror’s query parameters), converting along its chain of mirrored models into the root model’s query.
IntoValue
A raw value that can be handed to the persistence layer as a Value.
MergePatchNullableFields
A merge patch model: which of its fields a client may set to null (its Patch fields), as opposed to leaving them out.
NamesField
An item naming a domain field.
NullableFields
Which fields of a merge patch struct may be set to null, under its own names.
Ordered
A raw value the lt / gt filters can compare.
PatchField
A field of a merge patch, applied to the model’s field of type F.
PatchKind
What a merge patch field can say: whether its kind of field may be set to null at all, and whether this one is.
PersistedFields
A type whose data names domain fields the persistence layer maps onto columns.
QueryOf
A type converting into model M’s query model.
RawValue
A domain field type with a raw value behind it: the value filters compare with and merge patches bind.
SortDetailsOf
A type converting into model M’s sort details.
SortFieldOf
A sortable-fields enum mirroring model M’s, variant for variant.
Text
A raw value the sw / c / ew (LIKE) filters can match.

Type Aliases§

Conditions
The set filters of the model M, as database-agnostic conditions.
FieldValues
Fields of the model M to write, with their values.
SortKeys
The requested sorting of the model M, in order.