import { Kysely } from "kysely"; import { Pool } from "pg"; import type { Database } from "./schema"; /** * Environment interface for Hyperdrive binding. * Workers should pass their env object which must include HD_NOCACHE. */ export interface HyperdriveEnv { HD_NOCACHE: { connectionString: string; }; } /** * Kysely database instance type with our schema. */ export type KyselyDb = Kysely; /** * Creates a database connection without Hyperdrive caching. * Uses HD_NOCACHE binding for fresh reads after writes. * * @example * const { db, pool } = getDb(env); * const notes = await db.selectFrom("notes").selectAll().execute(); */ export declare function getDb(env: HyperdriveEnv): { db: Kysely; pool: Pool; };