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 | URL codec façade; writes expressions and reads expression plus legacy simple filters |
| @rapiq/adapter-sql | Dialect-agnostic SQL adapter (pg, mysql, sqlite, mssql, oracle presets) |
| @rapiq/adapter-typeorm | Applies a Query to a TypeORM SelectQueryBuilder |
| @rapiq/adapter-prisma | Serializes a Query into a Prisma argument object |
| @rapiq/adapter-drizzle | Serializes a Query into a Drizzle relational query config |
| @rapiq/adapter-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-urlAn HTTP API backed by TypeORM:
sh
npm install @rapiq/core @rapiq/codec-url @rapiq/adapter-sql @rapiq/adapter-typeormAn HTTP API backed by Prisma:
sh
npm install @rapiq/core @rapiq/codec-url @rapiq/adapter-prismaAn HTTP API backed by Drizzle:
sh
npm install @rapiq/core @rapiq/codec-url @rapiq/adapter-drizzleAn HTTP API composing SQL by hand:
sh
npm install @rapiq/core @rapiq/codec-url @rapiq/adapter-sqlSomething in-process (guards, tests, mock backends):
sh
npm install @rapiq/core @rapiq/adapter-memoryThen add per feature:
- MongoDB-style filter documents (e.g. JSON bodies) → @rapiq/parser-mongo
- non-URL canonical object input → @rapiq/parser-simple directly
Dependency layers
Foundation
Built on core
Dialects & backends
All packages are ESM-only, ship TypeScript types, and share the same export shape (single entry point).