feat(db): use wa-sqlite

This commit is contained in:
Samuel 2025-01-20 17:51:56 +01:00
parent 877fd5a806
commit 36ff7afa4a
14 changed files with 232 additions and 177 deletions

View file

@ -2,8 +2,8 @@ import { makePersisted } from "@solid-primitives/storage";
import { Kysely } from "kysely";
import type { DB } from "./db-schema";
import { createSignal } from "solid-js";
import { OfficialWasmWorkerDialect } from "~/lib/kysely-official-wasm-worker";
import wasmWorkerUrl from "~/lib/kysely-official-wasm-worker/worker?url";
import { WaSqliteWorkerDialect } from "~/lib/kysely-wasqlite-worker";
import wasmWorkerUrl from "~/lib/kysely-wasqlite-worker/worker?url";
export const SELF_ID = 2;
@ -13,7 +13,7 @@ export const worker = new Worker(wasmWorkerUrl, {
type: "module",
});
const dialect = new OfficialWasmWorkerDialect({
const dialect = new WaSqliteWorkerDialect({
fileName: DB_FILENAME,
preferOPFS: true,
worker,