2024-08-21 01:28:40 +00:00
|
|
|
import { createRequire } from "node:module";
|
|
|
|
const require = createRequire(import.meta.url);
|
2024-08-30 06:53:32 +00:00
|
|
|
|
2024-08-26 20:51:43 +00:00
|
|
|
type RowIterator = {
|
|
|
|
next: () => Buffer;
|
2024-08-29 20:39:27 +00:00
|
|
|
cleanup: () => void;
|
2024-08-26 20:51:43 +00:00
|
|
|
};
|
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
|
|
|
};
|
2024-08-30 06:53:32 +00:00
|
|
|
|
|
|
|
let Library: SQLite;
|
|
|
|
|
|
|
|
if (process.isBun) {
|
|
|
|
Library = require("./Bunding") as SQLite;
|
|
|
|
} else {
|
|
|
|
Library = require("./Binding") as SQLite;
|
|
|
|
}
|
|
|
|
|
|
|
|
export default Library;
|