@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remit/drizzle-service",
3
- "version": "0.0.100",
3
+ "version": "0.0.101",
4
4
  "description": "Drizzle ORM service over SQLite",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
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 { BetterSQLite3Database } from "drizzle-orm/better-sqlite3";
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
- * Internal to this adapter: it names better-sqlite3, so it is not exported from
7
- * the package index and never appears on a shared surface.
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
- BetterSQLite3Database<TSchema>;
10
+ export type Db<TSchema extends Record<string, unknown>> = BaseSQLiteDatabase<
11
+ "sync",
12
+ unknown,
13
+ TSchema
14
+ >;