datahub/apps/site/lib/mddb.ts
2023-04-11 08:19:58 -03:00

25 lines
545 B
TypeScript

import { MarkdownDB } from "@flowershow/markdowndb";
// import config from "./markdowndb.config.js";
// TODO get this path from markdowndb.config.js or something
const dbPath = "markdown.db";
//
// if (!config.dbPath)
// throw new Error("Invalid/Missing path in markdowndb.config.js");
// }
//
// const dbPath = config.dbPath;
// OR
// const dbOptions = config.dbOptions;
const client = new MarkdownDB({
client: "sqlite3",
connection: {
filename: dbPath,
},
});
const clientPromise = client.init();
export default clientPromise;