property DrizzleAdapterOptions.poolStats
Since 0.5.0

Application-owned callback reporting the driver's connection-pool counters (M90b). The application reads its own driver's documented pool API — the configured Drizzle identity is opaque to this package — and the adapter publishes the returned DatabasePoolCapacity snapshot to the database health indicator through an internal seam.

Omitted, the indicator carries no capacity fields. No threshold is applied: saturation is data, not policy.

Examples

Example 1

app.register(DatabasePlugin({
  type: 'drizzle',
  options: {
    drizzleInstance: createDrizzleDatabase(db, bridge),
    drizzleTables,
    poolStats: () => ({
      total: pool.totalCount,
      idle: pool.idleCount,
      waiting: pool.waitingCount,
    }),
  },
}));

Type

Usage

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