printFilter
printFilter(
ast):string
Defined in: packages/schema/src/filter/print.ts:6
Canonical text, readable by parseFilter; OR groups inside AND are always parenthesised. A checked filter prints its fields by name.
Parameters
Section titled “Parameters”{ kind: "search"; span: Span; text: string; } | { args: FilterOf<FieldModel, never>[]; kind: "and"; span: Span; } | { args: FilterOf<FieldModel, never>[]; kind: "or"; span: Span; } | { arg: FilterOf<FieldModel, never>; kind: "not"; span: Span; } | { field: FieldModel; kind: "compare"; op: CompareOp; span: Span; value: FilterValue; } | { field: FieldModel; kind: "has"; span: Span; value: Literal; } | { field: FieldModel; kind: "present"; span: Span; } | { field: FieldModel; kind: "in"; span: Span; values: Literal[]; } | { field: FieldModel; kind: "similar"; span: Span; text: string; } | { field: FieldModel; kind: "regex"; pattern: string; span: Span; } | { field: FieldModel; kind: "isNull"; span: Span; } | RelatedFilter | { args: FilterOf<FieldPath, RelatedFilter>[]; kind: "and"; span: Span; } | { args: FilterOf<FieldPath, RelatedFilter>[]; kind: "or"; span: Span; } | { arg: FilterOf<FieldPath, RelatedFilter>; kind: "not"; span: Span; } | { field: FieldPath; kind: "compare"; op: CompareOp; span: Span; value: FilterValue; } | { field: FieldPath; kind: "has"; span: Span; value: Literal; } | { field: FieldPath; kind: "present"; span: Span; } | { field: FieldPath; kind: "in"; span: Span; values: Literal[]; } | { field: FieldPath; kind: "similar"; span: Span; text: string; } | { field: FieldPath; kind: "regex"; pattern: string; span: Span; } | { field: FieldPath; kind: "isNull"; span: Span; }
Type Literal
Section titled “Type Literal”{ kind: "search"; span: Span; text: string; }
"search"
search("text") or bare words: every word appears in one of the resource’s search fields.
Where it stands in the filter text.
string
The text searched for.
Type Literal
Section titled “Type Literal”{ args: FilterOf<FieldModel, never>[]; kind: "and"; span: Span; }
FilterOf<FieldModel, never>[]
The filters joined.
"and"
Every one of args holds (AND).
Where it stands in the filter text.
Type Literal
Section titled “Type Literal”{ args: FilterOf<FieldModel, never>[]; kind: "or"; span: Span; }
FilterOf<FieldModel, never>[]
The filters joined.
"or"
One of args holds (OR).
Where it stands in the filter text.
Type Literal
Section titled “Type Literal”{ arg: FilterOf<FieldModel, never>; kind: "not"; span: Span; }
FilterOf<FieldModel, never>
The filter negated.
"not"
arg does not hold (NOT, -).
Where it stands in the filter text.
Type Literal
Section titled “Type Literal”{ field: FieldModel; kind: "compare"; op: CompareOp; span: Span; value: FilterValue; }
The field compared.
"compare"
A comparison of a field with a value.
The comparison.
Where it stands in the filter text.
What it is compared with.
Type Literal
Section titled “Type Literal”{ field: FieldModel; kind: "has"; span: Span; value: Literal; }
The field.
"has"
field:value: a JSON field holds the value as a key or element.
Where it stands in the filter text.
The value it holds.
Type Literal
Section titled “Type Literal”{ field: FieldModel; kind: "present"; span: Span; }
The field.
"present"
field:*: the field has a value.
Where it stands in the filter text.
Type Literal
Section titled “Type Literal”{ field: FieldModel; kind: "in"; span: Span; values: Literal[]; }
The field.
"in"
in(field, v, ...): the field equals one of the values.
Where it stands in the filter text.
values
Section titled “values”Literal[]
The values.
Type Literal
Section titled “Type Literal”{ field: FieldModel; kind: "similar"; span: Span; text: string; }
The field.
"similar"
similar(field, "text"): the field is like the text, by pg_trgm similarity.
Where it stands in the filter text.
string
The text it is compared with.
Type Literal
Section titled “Type Literal”{ field: FieldModel; kind: "regex"; pattern: string; span: Span; }
The field.
"regex"
regex(field, "pattern"): the field matches the regular expression.
pattern
Section titled “pattern”string
The regular expression.
Where it stands in the filter text.
Type Literal
Section titled “Type Literal”{ field: FieldModel; kind: "isNull"; span: Span; }
The field.
"isNull"
isNull(field): the field has no value.
Where it stands in the filter text.
Type Literal
Section titled “Type Literal”{ args: FilterOf<FieldPath, RelatedFilter>[]; kind: "and"; span: Span; }
FilterOf<FieldPath, RelatedFilter>[]
The filters joined.
"and"
Every one of args holds (AND).
Where it stands in the filter text.
Type Literal
Section titled “Type Literal”{ args: FilterOf<FieldPath, RelatedFilter>[]; kind: "or"; span: Span; }
FilterOf<FieldPath, RelatedFilter>[]
The filters joined.
"or"
One of args holds (OR).
Where it stands in the filter text.
Type Literal
Section titled “Type Literal”{ arg: FilterOf<FieldPath, RelatedFilter>; kind: "not"; span: Span; }
FilterOf<FieldPath, RelatedFilter>
The filter negated.
"not"
arg does not hold (NOT, -).
Where it stands in the filter text.
Type Literal
Section titled “Type Literal”{ field: FieldPath; kind: "compare"; op: CompareOp; span: Span; value: FilterValue; }
The field compared.
"compare"
A comparison of a field with a value.
The comparison.
Where it stands in the filter text.
What it is compared with.
Type Literal
Section titled “Type Literal”{ field: FieldPath; kind: "has"; span: Span; value: Literal; }
The field.
"has"
field:value: a JSON field holds the value as a key or element.
Where it stands in the filter text.
The value it holds.
Type Literal
Section titled “Type Literal”{ field: FieldPath; kind: "present"; span: Span; }
The field.
"present"
field:*: the field has a value.
Where it stands in the filter text.
Type Literal
Section titled “Type Literal”{ field: FieldPath; kind: "in"; span: Span; values: Literal[]; }
The field.
"in"
in(field, v, ...): the field equals one of the values.
Where it stands in the filter text.
values
Section titled “values”Literal[]
The values.
Type Literal
Section titled “Type Literal”{ field: FieldPath; kind: "similar"; span: Span; text: string; }
The field.
"similar"
similar(field, "text"): the field is like the text, by pg_trgm similarity.
Where it stands in the filter text.
string
The text it is compared with.
Type Literal
Section titled “Type Literal”{ field: FieldPath; kind: "regex"; pattern: string; span: Span; }
The field.
"regex"
regex(field, "pattern"): the field matches the regular expression.
pattern
Section titled “pattern”string
The regular expression.
Where it stands in the filter text.
Type Literal
Section titled “Type Literal”{ field: FieldPath; kind: "isNull"; span: Span; }
The field.
"isNull"
isNull(field): the field has no value.
Where it stands in the filter text.
Returns
Section titled “Returns”string