UNPKG

@cubicweb/rql-generator

Version:

Helpers to build RQL queries

49 lines 1.47 kB
import { Filter } from "./filter"; export interface EntityData { [key: string]: any; } export type EntityId = number; export type AttributeValue = string | number | boolean | null; export type OrberBy = Array<{ /** * Relation name to order results. * /!\ this relation should be in the RQL */ relationName: string; /** * Whether the results are in ascending or descending order. * Omitting this field will leave the default behavior (ascending order). */ ascending?: boolean; /** * Whether the nulls results should be in first or last positions. * Omitting this field will leabe the default behavior: * nulls last when ascending and nulls first when descending. */ nulls?: "first" | "last"; }>; export interface RqlQueryWhere { /** * A custom filter */ where?: Filter; } export interface RqlQuerySelectOptions extends RqlQueryWhere { /** * Max number of result to retrieve. */ limit?: number; /** * Offset from the first element. */ offset?: number; /** * ORDERBY clause of the RQL query. */ orderBy?: OrberBy; /** * The list of relation to resolve. Object relations must have the reverse prefix. See [@cubicweb/client:getReverseRelationType](https://cubicweb.pages.logilab.fr/cubicwebjs/client/functions/getReverseRelationType.html) */ relations: Array<string>; } //# sourceMappingURL=types.d.ts.map