jmou/yakatak
git clone https://github.com/jmou/yakatak.git
git clone git@github.com:jmou/yakatak.git
Loading…
(top)/app/server/utils/db.ts
language: TypeScript
227 Bytes / 11 lines / 9 loc
History
View raw
import { YakatakDb } from "@yakatak/db";

let db: YakatakDb | null = null;

export async function getDb(dbPath: string): Promise<YakatakDb> {
  if (!db) {
    db = new YakatakDb(dbPath);
    await db.init();
  }
  return db;
}