@remit/drizzle-service 0.0.100 → 0.0.101
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/package.json +1 -1
- package/src/batch.ts +2 -1
- package/src/db.ts +10 -6
package/package.json
CHANGED
package/src/batch.ts
CHANGED
|
@@ -28,7 +28,8 @@ const runSync = (item: SqliteBatchItem): unknown => {
|
|
|
28
28
|
* On better-sqlite3 the batch is one synchronous IMMEDIATE transaction: it
|
|
29
29
|
* never yields the event loop, so no other write on the shared connection lands
|
|
30
30
|
* inside it, and IMMEDIATE takes the file's write lock before the first
|
|
31
|
-
* statement so a writer in another process waits out the busy timeout.
|
|
31
|
+
* statement so a writer in another process waits out the busy timeout. On a
|
|
32
|
+
* Durable Object's `durable-sqlite` handle it is one `transactionSync`.
|
|
32
33
|
*/
|
|
33
34
|
export const runBatch = async <
|
|
34
35
|
TSchema extends Record<string, unknown>,
|
package/src/db.ts
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { BaseSQLiteDatabase } from "drizzle-orm/sqlite-core";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* The drizzle handle a repository runs on.
|
|
4
|
+
* The drizzle handle a repository runs on: any synchronous SQLite driver.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
6
|
+
* better-sqlite3 is the one this package opens; a Cloudflare Durable Object's
|
|
7
|
+
* `durable-sqlite` handle satisfies it too, so its adapter constructs the same
|
|
8
|
+
* repositories over its own storage.
|
|
8
9
|
*/
|
|
9
|
-
export type Db<TSchema extends Record<string, unknown>> =
|
|
10
|
-
|
|
10
|
+
export type Db<TSchema extends Record<string, unknown>> = BaseSQLiteDatabase<
|
|
11
|
+
"sync",
|
|
12
|
+
unknown,
|
|
13
|
+
TSchema
|
|
14
|
+
>;
|