dal/client/Library.ts
2024-08-30 08:53:32 +02:00

22 lines
438 B
TypeScript

import { createRequire } from "node:module";
const require = createRequire(import.meta.url);
type RowIterator = {
next: () => Buffer;
cleanup: () => void;
};
type SQLite = {
initSQLite: (pragmas: Buffer) => void;
rowIterator: (input: Buffer) => RowIterator;
};
let Library: SQLite;
if (process.isBun) {
Library = require("./Bunding") as SQLite;
} else {
Library = require("./Binding") as SQLite;
}
export default Library;