@nest-extended/typeorm
The TypeORM adapter: the same generic CRUD service and FeathersJS query language as the Prisma
adapter, translating operators to TypeORM FindOperators.
$npm install @nest-extended/core @nest-extended/typeorm @nest-extended/decorators nestjs-cls
Key exports
| Export | Type | Purpose |
|---|---|---|
NestService<T> | class | CRUD service wrapping a TypeORM Repository |
applyFilters() | function | Apply parsed filters to TypeORM find-options |
rawQuery() | function | Convert a FeathersJS query to a TypeORM where (Equal, MoreThan, ILike, …) |
GlobalExceptionFilter | filter | Maps QueryFailedError and driver codes (Postgres / MySQL / SQLite) to HTTP |
Usage
import { Injectable } from '@nestjs/common';
import { InjectRepository } from '@nestjs/typeorm';
import { Repository } from 'typeorm';
import { NestService } from '@nest-extended/typeorm';
import { Cat } from './entities/cat.entity';
@Injectable()
export class CatsService extends NestService<Cat> {
constructor(@InjectRepository(Cat) repo: Repository<Cat>) {
super(repo);
}
}await catsService._find({
name: { $iLike: 'kitty' },
age: { $gt: 5 },
$include: { owner: true },
$sort: { createdAt: -1 },
$limit: 10,
});The query API is identical to @nest-extended/prisma — relations use
$include, mapped to TypeORMrelations.