/** * Cloudflare D1 Adapter * * Wraps the native D1 binding with our interface. * Essentially a passthrough since D1 already matches our interface. * * The tool recedes; D1 is used transparently. */ import type { Database } from '../types.js'; interface D1Database { prepare(query: string): D1PreparedStatement; batch(statements: D1PreparedStatement[]): Promise[]>; exec(query: string): Promise; dump(): Promise; } interface D1PreparedStatement { bind(...values: unknown[]): D1PreparedStatement; all(): Promise>; first(columnName?: string): Promise; run(): Promise>; } interface D1Result { results?: T[]; success: boolean; meta: Record; } interface D1ExecResult { count: number; duration: number; } /** * Wrap D1 database with our platform-agnostic interface. * * @param d1 - Native Cloudflare D1 database binding * @returns Database interface that works with getPlatform() */ export declare function wrapD1(d1: D1Database): Database; /** * Type guard to check if an object is a D1 database. */ export declare function isD1Database(obj: unknown): obj is D1Database; export {};