@variablesoftware/mock-d1
Version:
🎛️🗂️🧠 Mock D1 Database implementation for testing Cloudflare Workers
17 lines (16 loc) • 701 B
TypeScript
/**
* @fileoverview
* Implementation of the MockD1PreparedStatement for mockD1Database.
* Provides a modular, handler-based mock prepared statement interface.
*/
import { MockD1PreparedStatement } from "../types/MockD1Database";
import type { D1TableData } from "../types/MockD1Database";
/**
* Creates a mock prepared statement for the given SQL and database state.
*
* @param sql - The SQL statement string.
* @param db - The in-memory database map.
* @returns A mock prepared statement implementing the D1 interface.
* @throws If the SQL is malformed or unsupported.
*/
export declare function createPreparedStatement(sql: string, db: Map<string, D1TableData>): MockD1PreparedStatement;