chore: update dependencies
This commit is contained in:
parent
576697c5d0
commit
05416af197
14 changed files with 1371 additions and 640 deletions
25
src/db/db.ts
Normal file
25
src/db/db.ts
Normal file
|
@ -0,0 +1,25 @@
|
|||
import { makePersisted } from "@solid-primitives/storage";
|
||||
import sqlite3InitModule from "@sqlite.org/sqlite-wasm";
|
||||
import { Kysely } from "kysely";
|
||||
import type { DB } from "./db-schema";
|
||||
import { OfficialWasmDialect } from "kysely-wasm";
|
||||
import { createSignal } from "solid-js";
|
||||
|
||||
export const SELF_ID = 2;
|
||||
|
||||
const sqlite3 = await sqlite3InitModule({
|
||||
print: console.log,
|
||||
printErr: console.error,
|
||||
});
|
||||
|
||||
export const db = new sqlite3.oo1.DB("signal");
|
||||
|
||||
const dialect = new OfficialWasmDialect({
|
||||
database: db,
|
||||
});
|
||||
|
||||
export const kyselyDb = new Kysely<DB>({
|
||||
dialect,
|
||||
});
|
||||
|
||||
export const [dbHash, setDbHash] = makePersisted(createSignal<number>());
|
Loading…
Add table
Add a link
Reference in a new issue