claude-db 0.10.0 → 0.10.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.10.1
4
+
5
+ ### Fixed
6
+
7
+ - **A second claude-db process no longer fails with `database is locked`.** The
8
+ SQLite database was opened with no wait time, so a hook that started while a
9
+ background job was writing (the clean-up or repair that runs after an update)
10
+ failed at once, and that session started without its memory block. The
11
+ connection now waits up to 3 seconds for the lock, which is under the 5 second
12
+ limit of the shortest hook. It showed up as one flaky macOS test after 0.10.0
13
+ was merged. SQLite only: Postgres and Mongo manage their own connections.
14
+
3
15
  ## 0.10.0
4
16
 
5
17
  ### Changed
@@ -8,6 +8,7 @@ import { dirname, resolve } from 'node:path';
8
8
  import { fileURLToPath } from 'node:url';
9
9
  import { mkdirSync, readFileSync } from 'node:fs';
10
10
  export const HERE = dirname(fileURLToPath(import.meta.url));
11
+ const BUSY_TIMEOUT_MS = 3000;
11
12
  export class SqliteStore {
12
13
  db;
13
14
  kind = 'sqlite';
@@ -17,7 +18,9 @@ export class SqliteStore {
17
18
  static async create(uri) {
18
19
  const path = toFilePath(uri);
19
20
  mkdirSync(dirname(path), { recursive: true });
20
- return new SqliteStore(new DatabaseSync(path));
21
+ const db = new DatabaseSync(path);
22
+ db.exec(`PRAGMA busy_timeout = ${BUSY_TIMEOUT_MS}`);
23
+ return new SqliteStore(db);
21
24
  }
22
25
  async init() {
23
26
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-db",
3
- "version": "0.10.0",
3
+ "version": "0.10.1",
4
4
  "description": "Persistent memory for Claude Code. Captures why decisions were made, not just which files changed. Bring your own database: SQLite, MongoDB or Postgres. No cloud, no subscription.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",