Package Overview
rapiq is a family of small packages around one shared data structure — the Query. Install only what each side of your application needs; @rapiq/core is a peer dependency of everything else.
The map
| Package | Role |
|---|---|
| @rapiq/core | Query AST, defineQuery + condition helpers, schema system, parser base classes, errors |
| @rapiq/parser-simple | Parses plain object/array input (URL-query-like "simple" dialect) |
| @rapiq/parser-expression | Parses function-call filter expressions (and(eq(name, 'John'), …)) |
| @rapiq/parser-mongo | Parses MongoDB-style filter documents ({ age: { $gte: 18 } }) |
| @rapiq/codec-url-simple | URL query-string encoder & decoder for the simple dialect |
| @rapiq/codec-url-expression | URL codec carrying nested filter compounds in one filter=and(...) param |
| @rapiq/codec-url | Registry dispatching between URL dialects via the in-band codec param |
| @rapiq/sql | Dialect-agnostic SQL adapter (pg, mysql, sqlite, mssql, oracle presets) |
| @rapiq/typeorm | Applies a Query to a TypeORM SelectQueryBuilder |
| @rapiq/memory | Evaluates a Query against in-memory objects & arrays |
Which packages do I need?
A frontend that builds and sends queries:
sh
npm install @rapiq/core @rapiq/codec-url-simpleAn HTTP API backed by TypeORM:
sh
npm install @rapiq/core @rapiq/codec-url-simple @rapiq/sql @rapiq/typeormAn HTTP API composing SQL by hand:
sh
npm install @rapiq/core @rapiq/codec-url-simple @rapiq/sqlSomething in-process — guards, tests, mock backends:
sh
npm install @rapiq/core @rapiq/memoryThen add per feature:
- nested
and/orfilters over URLs → @rapiq/codec-url-expression - both URL dialects on one endpoint → @rapiq/codec-url
- MongoDB-style filter documents (e.g. JSON bodies) → @rapiq/parser-mongo
- non-URL canonical object input → @rapiq/parser-simple directly
Dependency layers
Foundation
Dialects & backends
Codec composition
All packages are ESM-only, ship TypeScript types, and share the same export shape (single entry point).