Use TypeORM with DaloyJS
TypeORM gives you decorator-based entities and the active-record / data-mapper patterns familiar to Java and .NET teams. It runs best on the Node.js adapter.
- 01clientHTTP requestGET /users/:id
- 02zodValidated inputparams.id is a uuid
- 03typeormRepository querygetRepository(User).findOneBy(...)
- 04responseTyped body200 UserSchema | 404
1. Install
TypeORM relies on reflect-metadata and decorator metadata. Make sure your tsconfig.json enables them:
2. Define an entity
3. Configure the DataSource
4. Create a TypeORM plugin
5. Augment app state types
6. Use repositories in routes
Transactions
Migrations
Runtime notes
- TypeORM uses Node-only APIs (filesystem, native drivers). It does not run on Cloudflare Workers or Vercel, use Drizzle or Supabase there.
- On Bun and Deno, prefer
drizzle-style postgres clients unless you need TypeORM's decorators. - Always import
reflect-metadataonce at the entrypoint, before anything else.
Compare with Prisma, Drizzle, MikroORM, Sequelize, or the ODM overview if you need document models.