(
input: ConstructorOptions,
debug: (arg: string) => void,
adapter: ErrorCapturingSqlDriverAdapterFactory,
)
| 33 | let loadedWasmInstance: typeof SchemaEngine |
| 34 | export const wasmSchemaEngineLoader = { |
| 35 | async loadSchemaEngine( |
| 36 | input: ConstructorOptions, |
| 37 | debug: (arg: string) => void, |
| 38 | adapter: ErrorCapturingSqlDriverAdapterFactory, |
| 39 | ) { |
| 40 | // we only create the instance once for efficiency and also because wasm |
| 41 | // bindgen keeps an internal cache of its instance already, when the wasm |
| 42 | // compiler is loaded more than once it crashes with `unwrap_throw failed`. |
| 43 | if (loadedWasmInstance === undefined) { |
| 44 | loadedWasmInstance = await getSchemaEngineWasmInstance() |
| 45 | } |
| 46 | |
| 47 | return await loadedWasmInstance.new(input, debug, adapter) |
| 48 | }, |
| 49 | } |
nothing calls this directly
no test coverage detected