Skip to content

Commit ecbb326

Browse files
committed
chore: fix loading database from current path
1 parent d350194 commit ecbb326

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

db/drizzle.web.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@ import { type SQLJsDatabase, drizzle } from "drizzle-orm/sql-js";
22
import initSqlJs from "sql.js";
33
import { useDatabase } from "./provider";
44
import { useEffect, useReducer } from "react";
5-
import { habitTable } from "./schema";
65

76
export const initialize = async (): Promise<SQLJsDatabase> => {
87
const sqlPromise = initSqlJs({
98
locateFile: (file) => `https://sql.js.org/dist/${file}`,
109
});
11-
const dataPromise = fetch("/database.sqlite").then((res) =>
10+
const dataPromise = fetch("./database.sqlite").then((res) =>
1211
res.arrayBuffer(),
1312
);
1413
const [SQL, buf] = await Promise.all([sqlPromise, dataPromise]);

0 commit comments

Comments
 (0)