@drzl-enhanced/generator-orpc
v0.0.4
Published
<div align="center">
Readme
@drzl-enhanced/generator-orpc
oRPC routers per table — with optional reuse of shared validation schemas.
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.
