deliver Hongfa Laundry M1 desktop release
This commit is contained in:
13
src/main/db/client.ts
Normal file
13
src/main/db/client.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { drizzle } from "drizzle-orm/better-sqlite3";
|
||||
import type Database from "better-sqlite3";
|
||||
import * as schema from "./schema";
|
||||
import { migrate } from "./migrate";
|
||||
|
||||
export function createDbClient(sqlite: Database.Database) {
|
||||
migrate(sqlite);
|
||||
return drizzle(sqlite, { schema });
|
||||
}
|
||||
|
||||
export type AppDb = ReturnType<typeof createDbClient>;
|
||||
export type AppTransaction = Parameters<Parameters<AppDb["transaction"]>[0]>[0];
|
||||
export type DbExecutor = AppDb | AppTransaction;
|
||||
Reference in New Issue
Block a user