interface DatabaseAdapterOptions
Since 0.1.0

Adapter-specific configuration passed to the database adapter.

Properties

deprecated
Since 0.1.0
readonly
optional
url: string

Database connection URL (e.g., postgresql://localhost:5432/mydb).

Since 0.1.0
readonly
optional
logQueries: boolean

When true, log SQL queries to the registered logger.

Since 0.1.0
readonly
optional
prismaClient: unknown

Inject an application-generated Prisma v7 client. This is required for the Prisma adapter because generated-client output belongs to the application rather than this package — see PrismaAdapterOptions, which makes that a compile error rather than a startup throw.

A Prisma 7 client needs a driver adapter of its own (new PrismaClient({ adapter: new PrismaPg({ connectionString }) })); the engine-bundled new PrismaClient() constructor was removed in v7.

Since 0.2.0
readonly
optional
provider: PrismaSqlProvider

The SQL connector the injected Prisma client is bound to.

Only contains is connector-sensitive in the Prisma adapter. When omitted the adapter reads the client's active provider structurally at connect() time; when that cannot be determined, a contains filter throws UnsupportedFilterOperatorError naming this option as the fix. Pass it explicitly when the adapter cannot detect the connector.

Since 0.1.0
readonly
optional
drizzleTables: Record<string, unknown>

Registry mapping entity name → a real Drizzle table definition. Required when type: 'drizzle' — see DrizzleAdapterOptions, which makes that a compile error rather than a startup throw.

The registry accepts any table definition, including one with a composite primary key. An id column is a REPOSITORY precondition (findById, update and delete are single-key by contract), so it is checked when a repository is asked for rather than at connect() — a table registered only so the typed query builder can name it needs none.

Since 0.1.0
readonly
optional
transactionTimeout: number

Timeout (ms) for Prisma interactive transactions. Defaults to 30_000. Prisma's default is ~5s which is too short for a full Unit of Work.

Read by the Prisma adapter only; Memory and Drizzle ignore it.

Since 0.1.0
readonly
optional
drizzleInstance: DrizzleDatabaseIdentity

Inject the application's opaque configured Drizzle database, created by createDrizzleDatabase(database, transactionBridge). Required when type: 'drizzle' — see DrizzleAdapterOptions, which makes that a compile error rather than a startup throw. The explicit bridge positively guarantees Promise-aware native callback semantics instead of inferring them from a structural transaction method.

Usage

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