refactor(infra): split provider usage

This commit is contained in:
Peter Steinberger
2026-01-14 05:40:03 +00:00
parent e2f8909982
commit 3e0e608110
21 changed files with 1583 additions and 1484 deletions

22
src/memory/sqlite.ts Normal file
View File

@@ -0,0 +1,22 @@
import { createRequire } from "node:module";
const require = createRequire(import.meta.url);
export function requireNodeSqlite(): typeof import("node:sqlite") {
const onWarning = (warning: Error & { name?: string; message?: string }) => {
if (
warning.name === "ExperimentalWarning" &&
warning.message?.includes("SQLite is an experimental feature")
) {
return;
}
process.stderr.write(`${warning.stack ?? warning.toString()}\n`);
};
process.on("warning", onWarning);
try {
return require("node:sqlite") as typeof import("node:sqlite");
} finally {
process.off("warning", onWarning);
}
}