@concavejs/docstore-better-sqlite3 0.0.1-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/better-sqlite3-adapter.d.ts +21 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +9249 -0
- package/dist/sqlite-docstore.d.ts +20 -0
- package/package.json +34 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* better-sqlite3 adapter implementation
|
|
3
|
+
*
|
|
4
|
+
* Provides a synchronous SQLite adapter using better-sqlite3,
|
|
5
|
+
* which works in Electron without --experimental-sqlite flags.
|
|
6
|
+
*/
|
|
7
|
+
import type Database from "better-sqlite3";
|
|
8
|
+
import { type SqliteAdapter, type PreparedStatement, type SqlParam, type TransactionFn } from "@concavejs/docstore-sqlite-base";
|
|
9
|
+
/**
|
|
10
|
+
* better-sqlite3 adapter for SqliteAdapter interface
|
|
11
|
+
*/
|
|
12
|
+
export declare class BetterSqlite3Adapter implements SqliteAdapter {
|
|
13
|
+
private db;
|
|
14
|
+
private readonly runSerializedTransaction;
|
|
15
|
+
constructor(db: Database.Database);
|
|
16
|
+
exec(sql: string): void;
|
|
17
|
+
prepare(sql: string): PreparedStatement;
|
|
18
|
+
transaction<T>(fn: TransactionFn<T>): Promise<T>;
|
|
19
|
+
hexToBuffer(hex: string): SqlParam;
|
|
20
|
+
bufferToHex(buffer: any): string;
|
|
21
|
+
}
|
package/dist/index.d.ts
ADDED