Skip to content

basalt / ai/src / renderPrismaRepository

Function: renderPrismaRepository() ​

> renderPrismaRepository(name, fields, options): string

Defined in: ai/src/make/repository.ts:42

Render a complete Prisma repository for a resource — replacing the generator's, which (a) only maps id/name/timestamps (dropping domain fields) and (b) relies on the global tenancy extension to stamp tenantId. This one maps every domain field and, when tenant-scoped, scopes tenantId explicitly from the request context, so it works even on a raw client shared with non-tenant models.

Parameters ​

name ​

string

fields ​

PlanField[]

options ​

RepositoryOptions

Returns ​

string

Released under the MIT License.