dal/client/Library.ts

22 lines
438 B
TypeScript
Raw Normal View History

2024-08-21 01:28:40 +00:00
import { createRequire } from "node:module";
const require = createRequire(import.meta.url);
type RowIterator = {
next: () => Buffer;
2024-08-29 20:39:27 +00:00
cleanup: () => void;
};
2024-08-21 01:28:40 +00:00
type SQLite = {
2024-08-29 20:13:48 +00:00
initSQLite: (pragmas: Buffer) => void;
rowIterator: (input: Buffer) => RowIterator;
2024-08-21 01:28:40 +00:00
};
let Library: SQLite;
if (process.isBun) {
Library = require("./Bunding") as SQLite;
} else {
Library = require("./Binding") as SQLite;
}
export default Library;