disable WASM SQLite engine, use KV backend only

This commit is contained in:
codecolorist
2026-04-14 14:34:58 +00:00
parent 19378d32f3
commit 59f2ebb268
+1 -21
View File
@@ -1,28 +1,8 @@
import type { Engine } from "./types";
import { WASMEngine } from "./wasm";
import { checkWASMSupport as checkSQLiteWASMSupport } from "./wasm";
import { KVEngine } from "./kv";
let wasmSupported: boolean | null = null;
const wasmDisabled = process.env.NEXT_PUBLIC_USE_WASM === "0";
async function checkWASMSupport(): Promise<boolean> {
if (wasmSupported !== null) return wasmSupported;
wasmSupported = await checkSQLiteWASMSupport();
return wasmSupported;
}
export async function createEngine(group: string): Promise<Engine> {
if (wasmDisabled) {
return new KVEngine(group);
}
const supported = await checkWASMSupport();
if (supported) {
return new WASMEngine();
}
return new KVEngine(group);
}
export { KVEngine, WASMEngine };
export { KVEngine };