@drzl/generator-orpc
v1.1.0
Published
<div align="center">
Readme
@drzl/generator-orpc
oRPC routers per table — with optional reuse of shared validation schemas.
💚 Sponsor DRZL
DRZL is crafted nights & weekends. Sponsorships keep the generators fast, tested, and free.
- Every dollar speeds up CI hardware and offsets long test runs on my aging laptop.
- Sponsors get roadmap input and priority responses in GitHub Issues.
- Prefer a quick overview? Check
docs/sponsor.mdfor the current goals and thank-yous.
Use
Add to drzl.config.ts:
generators: [
{
kind: 'orpc',
template: '@drzl/template-orpc-service',
includeRelations: true,
validation: { library: 'valibot' },
databaseInjection: {
enabled: true,
databaseType: 'Database',
databaseTypeImport: { name: 'Database', from: 'src/db/db' },
},
servicesDir: 'src/services',
},
];Behavior
- Reuses pre-generated Insert/Update/Select schemas when
validation.useSharedis true. - Otherwise, inlines schemas using the chosen library (zod/valibot/arktype).
- Works with templates for different wiring (service-backed, minimal, custom). With
@drzl/template-orpc-service, adbMiddlewareis emitted andcontext.dbis passed to services.
