how do i use Drizzle?
I'm trying to use Drizzle db on the server only and its giving me "Uncaught TypeError: promisify is not a function" in the browser.
this is what
this is what
lib/db looks likelib/dbimport { cache, createAsync } from "@solidjs/router";
import { db } from "~/lib/db";
const getData = cache(() => {
return db.query.chat.findMany();
}, "data");
export const route = { load: getData };
export default function Home() {
const data = createAsync(() => getData());
return <p>{data()?.length}</p>;
}import Database from "better-sqlite3";
import { drizzle } from "drizzle-orm/better-sqlite3";
import * as schema from "./schema";
import { migrate } from "drizzle-orm/better-sqlite3/migrator";
export const db = drizzle(new Database("db.sqlite"), { schema });
migrate(db, { migrationsFolder: "drizzle" });