Sieve Driver
ArchivedThese are the docs for ng-qubee 3.8. Read the 4.0 docs for @qubeejs/angular.
Targets Sieve — the popular filtering, sorting, and pagination library for ASP.NET Core, with its compact single-parameter expression syntax.
Configure
Section titled “Configure”import { DriverEnum, provideNgQubee } from 'ng-qubee';
bootstrapApplication(AppComponent, { providers: [provideNgQubee({ driver: DriverEnum.SIEVE })]});Wire format
Section titled “Wire format”| Concern | Output |
|---|---|
| Filters (single value) | filters=field==value |
| Filters (multi-value) | filters=field==v1|v2 (value-level pipe OR) |
| Filters (combined) | comma = AND: filters=status==active,price>=100 |
| Operator filters | full FilterOperatorEnum mapping — see below |
| Sort | sorts=likeCount,-createdDate (CSV, - prefix = DESC) |
| Pagination | page=N&pageSize=N |
All filter terms — simple and operator alike — merge into one filters= parameter, AND-joined with commas.
Operator filters
Section titled “Operator filters”FilterOperatorEnum translates to Sieve’s inline operator symbols:
import { FilterOperatorEnum } from 'ng-qubee';
qb.addFilterOperator('likeCount', FilterOperatorEnum.GTE, 4); // likeCount>=4qb.addFilterOperator('title', FilterOperatorEnum.CONTAINS, 'world'); // title@=worldqb.addFilterOperator('title', FilterOperatorEnum.ILIKE, 'World'); // title@=*Worldqb.addFilterOperator('title', FilterOperatorEnum.SW, 'Intro'); // title_=Introqb.addFilterOperator('id', FilterOperatorEnum.IN, 1, 2, 3); // id==1|2|3qb.addFilterOperator('status', FilterOperatorEnum.NOT, 'draft'); // status!=draftqb.addFilterOperator('status', FilterOperatorEnum.NOT, 'a', 'b'); // status!=a,status!=bqb.addFilterOperator('deletedAt', FilterOperatorEnum.NULL, true); // deletedAt==nullqb.addFilterOperator('deletedAt', FilterOperatorEnum.NULL, false); // deletedAt!=nullqb.addFilterOperator('price', FilterOperatorEnum.BTW, 10, 50); // price>=10,price<=50Translation table
Section titled “Translation table”FilterOperatorEnum |
Sieve expression |
|---|---|
EQ |
== |
GT / GTE / LT / LTE |
> / >= / < / <= |
CONTAINS |
@= |
ILIKE |
@=* (case-insensitive contains) |
IN |
== with value-level pipe OR (field==v1|v2) |
SW |
_= (starts with) |
BTW |
two AND-ed terms (field>=min,field<=max, arity-checked) |
NOT (single) |
!= |
NOT (multi) |
one != term per value, AND-ed |
NULL (true) |
==null |
NULL (false) |
!=null |
FTS / PHFTS / PLFTS / WFTS |
unsupported — throws UnsupportedFilterOperatorError |
Value shape rules
Section titled “Value shape rules”Enforced at call time — both throw InvalidFilterOperatorValueError:
BTWrequires exactly 2 values (min,max).NULLrequires exactly 1 boolean value (true→==null,false→!=null).
Other operators leave shape validation to the server.
Feature matrix
Section titled “Feature matrix”| Method | Supported? | Notes |
|---|---|---|
addFilter / deleteFilters |
✓ | Folds to == (single) or value-level pipe OR (multi) |
addFilterOperator / deleteOperatorFilters |
✓ | See translation table above |
addSort / deleteSorts |
✓ | CSV sorts= with - prefix for DESC |
setLimit / setPage |
✓ | page + pageSize |
addSelect / deleteSelect |
✗ | Sieve has no column-projection parameter |
addFields / deleteFields / deleteFieldsByModel |
✗ | No per-model field selection |
addIncludes / deleteIncludes |
✗ | No relation-loading parameter |
addEmbedded / deleteEmbedded |
✗ | PostgREST-only — throws UnsupportedEmbeddedError |
setSearch / deleteSearch |
✗ | No global search — use CONTAINS / ILIKE operator filters for partial matches |
Response shape
Section titled “Response shape”Sieve does not define a response envelope — it returns an IQueryable your ASP.NET controller wraps in a paging DTO. The driver ships defaults for the common hand-rolled PagedResult<T> shape:
{ "data": [{ "id": 1, "title": "Hello" }], "page": 2, "pageSize": 10, "total": 48, "totalPages": 5}SieveResponseStrategy reads { data, page, pageSize, total, totalPages } and computes from/to from page × pageSize. The envelope key paths are fully configurable (dot notation supported), so any wrapper your backend emits can be mapped without subclassing:
provideNgQubee({ driver: DriverEnum.SIEVE, response: { currentPage: 'meta.page', data: 'items', lastPage: 'meta.pages', perPage: 'meta.size', total: 'meta.count' }});Defaults are encoded in SieveResponseOptions.