function createPrismaDataSource
Since 0.1.0
createPrismaDataSource(
client: PrismaClient,
entity: string,
provider?: PrismaSqlProvider,
keyColumns?: readonly string[],
compoundKeyField?: string
): DataSource

Creates a DataSource backed by a Prisma client for the given entity name.

Convention: entity name 'User' → delegate accessed as client.user (first letter lowercased). If the delegate is absent on the client, the error names the entity and the convention so the caller can fix the entity name.

Parameters

client: PrismaClient

The Prisma client (or transaction client) instance

entity: string

Entity / model name (e.g. 'User')

optional
provider: PrismaSqlProvider

The Prisma SQL provider (connector)

optional
keyColumns: readonly string[]

The resolved primary-key columns (defaults to ['id'])

optional
compoundKeyField: string

The compound-key field name, or undefined for scalar keys

Return Type

A data source bound to the Prisma model

Usage

import { createPrismaDataSource } from "database-plugin/src/index.ts";