UNPKG

@variablesoftware/mock-d1

Version:

🎛️🗂️🧠 Mock D1 Database implementation for testing Cloudflare Workers

22 lines (21 loc) 873 B
/** * @file engine/tableUtils/tableLookup.ts * @description Utilities for D1-like table and column lookup (case-insensitive, D1-compatible). */ /** * Finds the canonical table key in the database Map, case-insensitively (D1-compatible). * @param db - The database Map. * @param tableName - The table name to look up. * @returns The canonical table key if found, or undefined. */ export declare function findTableKey(db: Map<string, unknown>, tableName: string): string | undefined; /** * Finds the canonical column key in a schema, case-insensitively (D1-compatible). * @param columns - The schema columns array. * @param columnName - The column name to look up. * @returns The canonical column key if found, or undefined. */ export declare function findColumnKey(columns: { name: string; quoted: boolean; }[], columnName: string): string | undefined;