import { HealthCheck } from '@platform-modules/util/health';
import { Schema, Querier } from './index.js';
import 'drizzle-orm/pg-core';
import 'drizzle-orm';

interface DbHealthOptions {
    /** Name surfaced in the `HealthResult` (default `'db'`). */
    name?: string;
}
/**
 * A `SELECT 1` round-trip probe over any query-capable handle.
 *
 * Returns a `HealthCheck` whose `check()` NEVER throws — a failed query becomes
 * `status:'down'` with a GENERIC `detail`. The raw driver error is deliberately
 * swallowed: it can carry a DSN, credentials, or host topology and must never
 * reach an admin screen or log (info-disclosure hard floor).
 */
declare function healthCheck<S extends Schema = Record<string, never>>(db: Querier<S>, opts?: DbHealthOptions): HealthCheck;

export { type DbHealthOptions, healthCheck };
