Skip to content

Commit

Permalink
tried a new storage path format
Browse files Browse the repository at this point in the history
  • Loading branch information
Inalegwu committed Jul 23, 2024
1 parent ca19583 commit 937bb1d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ build({
},
mac: {
target: ["dmg"],
hardenedRuntime: true,
},
win: {
target: [
Expand Down
2 changes: 1 addition & 1 deletion electron.vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default defineConfig({
entry: "src/main.ts",
},
rollupOptions: {
external: ["better-sqlite3", "node-unrar-js"],
external: ["better-sqlite3"],
},
},
resolve: {
Expand Down
7 changes: 6 additions & 1 deletion src/shared/storage.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
import Database from "better-sqlite3";
import { drizzle } from "drizzle-orm/better-sqlite3";
import path from "node:path";
import * as schema from "./schema";

const sqlite = new Database("vision.db");
const dbPath = import.meta.env.DEV
? "vision.db"
: path.join(process.resourcesPath, "./vision.db");

const sqlite = new Database(dbPath);
const db = drizzle(sqlite, { schema });

export default db;

0 comments on commit 937bb1d

Please sign in to comment.