function createDrizzleDataSource
Since 0.1.0
createDrizzleDataSource(
instance: DrizzleInstance,
entity: string,
tables: Record<string, unknown>,
operators: DrizzleOperators
): DataSource

Creates a DataSource backed by a Drizzle instance for the given entity name.

The entity must exist in the drizzleTables registry; otherwise this throws naming the entity and the option.

Parameters

instance: DrizzleInstance

The Drizzle instance (or transaction instance)

entity: string

Entity / table name

tables: Record<string, unknown>

Table registry from adapter options

operators: DrizzleOperators

Drizzle operators loaded at connect

Return Type

A data source bound to the Drizzle table

Usage

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